diff options
author | Wenchen Fan <wenchen@databricks.com> | 2017-01-05 17:40:27 -0800 |
---|---|---|
committer | Yin Huai <yhuai@databricks.com> | 2017-01-05 17:40:27 -0800 |
commit | cca945b6aa679e61864c1cabae91e6ae7703362e (patch) | |
tree | f7b33ef60fc92237503fb911270b8bedba76815b /examples/src/main/java | |
parent | f5d18af6a8a0b9f8c2e9677f9d8ae1712eb701c6 (diff) | |
download | spark-cca945b6aa679e61864c1cabae91e6ae7703362e.tar.gz spark-cca945b6aa679e61864c1cabae91e6ae7703362e.tar.bz2 spark-cca945b6aa679e61864c1cabae91e6ae7703362e.zip |
[SPARK-18885][SQL] unify CREATE TABLE syntax for data source and hive serde tables
## What changes were proposed in this pull request?
Today we have different syntax to create data source or hive serde tables, we should unify them to not confuse users and step forward to make hive a data source.
Please read https://issues.apache.org/jira/secure/attachment/12843835/CREATE-TABLE.pdf for details.
TODO(for follow-up PRs):
1. TBLPROPERTIES is not added to the new syntax, we should decide if we wanna add it later.
2. `SHOW CREATE TABLE` should be updated to use the new syntax.
3. we should decide if we wanna change the behavior of `SET LOCATION`.
## How was this patch tested?
new tests
Author: Wenchen Fan <wenchen@databricks.com>
Closes #16296 from cloud-fan/create-table.
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 052153c9e9..8d06d38cf2 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 @@ -64,7 +64,7 @@ public class JavaSparkHiveExample { .enableHiveSupport() .getOrCreate(); - spark.sql("CREATE TABLE IF NOT EXISTS src (key INT, value STRING)"); + spark.sql("CREATE TABLE IF NOT EXISTS src (key INT, value STRING) USING hive"); spark.sql("LOAD DATA LOCAL INPATH 'examples/src/main/resources/kv1.txt' INTO TABLE src"); // Queries are expressed in HiveQL |