diff options
author | Daoyuan Wang <daoyuan.wang@intel.com> | 2014-11-14 13:51:20 -0800 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2014-11-14 13:51:20 -0800 |
commit | ade72c436276237f305d6a6aa4b594d43bcc4743 (patch) | |
tree | c052822ee7ab25772e2fbbd751515971bea3db9f /sql/hive/compatibility | |
parent | c258db9ed4104b6eefe9f55f3e3959a3c46c2900 (diff) | |
download | spark-ade72c436276237f305d6a6aa4b594d43bcc4743.tar.gz spark-ade72c436276237f305d6a6aa4b594d43bcc4743.tar.bz2 spark-ade72c436276237f305d6a6aa4b594d43bcc4743.zip |
[SPARK-4239] [SQL] support view in HiveQl
Currently still not support view like
CREATE VIEW view3(valoo)
TBLPROPERTIES ("fear" = "factor")
AS SELECT upper(value) FROM src WHERE key=86;
because the text in metastore for this view is like
select \`_c0\` as \`valoo\` from (select upper(\`src\`.\`value\`) from \`default\`.\`src\` where ...) \`view3\`
while catalyst cannot resolve \`_c0\` for this query.
For view without colname definition in parentheses, it works fine.
Author: Daoyuan Wang <daoyuan.wang@intel.com>
Closes #3131 from adrian-wang/view and squashes the following commits:
8a56fd6 [Daoyuan Wang] michael's comments
e46c056 [Daoyuan Wang] add some golden file
079290a [Daoyuan Wang] remove useless import
88afcad [Daoyuan Wang] support view in HiveQl
Diffstat (limited to 'sql/hive/compatibility')
-rw-r--r-- | sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala b/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala index 1a3c24be42..7c0be4872d 100644 --- a/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala +++ b/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala @@ -103,6 +103,7 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "udf5", "udf_java_method", "create_merge_compressed", + "create_view_partitioned", "database_location", "database_properties", @@ -969,6 +970,9 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "union_script", "varchar_2", "varchar_join1", - "varchar_union1" + "varchar_union1", + "view", + "view_cast", + "view_inputs" ) } |