aboutsummaryrefslogtreecommitdiff
path: root/sql/hive/src/test/resources/sqlgen/subq2.sql
diff options
context:
space:
mode:
authorDongjoon Hyun <dongjoon@apache.org>2016-07-27 23:29:26 -0700
committerReynold Xin <rxin@databricks.com>2016-07-27 23:29:26 -0700
commit5c2ae79bfcf448d8dc9217efafa1409997c739de (patch)
tree499879db863fec1f6081b8a12f96af13f93667af /sql/hive/src/test/resources/sqlgen/subq2.sql
parent11d427c924d303e20af90c0179a105f6ff4d89e2 (diff)
downloadspark-5c2ae79bfcf448d8dc9217efafa1409997c739de.tar.gz
spark-5c2ae79bfcf448d8dc9217efafa1409997c739de.tar.bz2
spark-5c2ae79bfcf448d8dc9217efafa1409997c739de.zip
[SPARK-15232][SQL] Add subquery SQL building tests to LogicalPlanToSQLSuite
## What changes were proposed in this pull request? We currently test subquery SQL building using the `HiveCompatibilitySuite`. The is not desired since SQL building is actually a part of `sql/core` and because we are slowly reducing our dependency on Hive. This PR adds the same tests from the whitelist of `HiveCompatibilitySuite` into `LogicalPlanToSQLSuite`. ## How was this patch tested? This adds more testcases. Pass the Jenkins tests. Author: Dongjoon Hyun <dongjoon@apache.org> Closes #14383 from dongjoon-hyun/SPARK-15232.
Diffstat (limited to 'sql/hive/src/test/resources/sqlgen/subq2.sql')
-rw-r--r--sql/hive/src/test/resources/sqlgen/subq2.sql8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/hive/src/test/resources/sqlgen/subq2.sql b/sql/hive/src/test/resources/sqlgen/subq2.sql
new file mode 100644
index 0000000000..ee7e80c1fc
--- /dev/null
+++ b/sql/hive/src/test/resources/sqlgen/subq2.sql
@@ -0,0 +1,8 @@
+-- This file is automatically generated by LogicalPlanToSQLSuite.
+SELECT a.k, a.c
+FROM (SELECT b.key as k, count(1) as c
+ FROM src b
+ GROUP BY b.key) a
+WHERE a.k >= 90
+--------------------------------------------------------------------------------
+SELECT `gen_attr_0` AS `k`, `gen_attr_1` AS `c` FROM (SELECT `gen_attr_0`, `gen_attr_1` FROM (SELECT `gen_attr_2` AS `gen_attr_0`, count(1) AS `gen_attr_1` FROM (SELECT `key` AS `gen_attr_2`, `value` AS `gen_attr_3` FROM `default`.`src`) AS gen_subquery_0 GROUP BY `gen_attr_2`) AS a WHERE (`gen_attr_0` >= 90)) AS a