diff options
author | Cheng Lian <lian@databricks.com> | 2016-07-23 11:41:24 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-07-23 11:41:24 -0700 |
commit | 53b2456d1de38b9d4f18509e7b36eb3fbe09e050 (patch) | |
tree | 7a783f09648b4c86ec04b9fd26e9ef6871f2d352 /examples/src/main/java | |
parent | 86c275206605c44e1ebca2f166d62868e44bf029 (diff) | |
download | spark-53b2456d1de38b9d4f18509e7b36eb3fbe09e050.tar.gz spark-53b2456d1de38b9d4f18509e7b36eb3fbe09e050.tar.bz2 spark-53b2456d1de38b9d4f18509e7b36eb3fbe09e050.zip |
[SPARK-16380][EXAMPLES] Update SQL examples and programming guide for Python language binding
This PR is based on PR #14098 authored by wangmiao1981.
## What changes were proposed in this pull request?
This PR replaces the original Python Spark SQL example file with the following three files:
- `sql/basic.py`
Demonstrates basic Spark SQL features.
- `sql/datasource.py`
Demonstrates various Spark SQL data sources.
- `sql/hive.py`
Demonstrates Spark SQL Hive interaction.
This PR also removes hard-coded Python example snippets in the SQL programming guide by extracting snippets from the above files using the `include_example` Liquid template tag.
## How was this patch tested?
Manually tested.
Author: wm624@hotmail.com <wm624@hotmail.com>
Author: Cheng Lian <lian@databricks.com>
Closes #14317 from liancheng/py-examples-update.
Diffstat (limited to 'examples/src/main/java')
-rw-r--r-- | examples/src/main/java/org/apache/spark/examples/sql/hive/JavaSparkHiveExample.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/src/main/java/org/apache/spark/examples/sql/hive/JavaSparkHiveExample.java b/examples/src/main/java/org/apache/spark/examples/sql/hive/JavaSparkHiveExample.java index 493d759a91..76dd160d55 100644 --- a/examples/src/main/java/org/apache/spark/examples/sql/hive/JavaSparkHiveExample.java +++ b/examples/src/main/java/org/apache/spark/examples/sql/hive/JavaSparkHiveExample.java @@ -104,7 +104,7 @@ public class JavaSparkHiveExample { // |Key: 0, Value: val_0| // ... - // You can also use DataFrames to create temporary views within a HiveContext. + // You can also use DataFrames to create temporary views within a SparkSession. List<Record> records = new ArrayList<>(); for (int key = 1; key < 100; key++) { Record record = new Record(); |