diff options
author | Bogdan Raducanu <bogdan.rdc@gmail.com> | 2017-01-17 15:39:24 -0800 |
---|---|---|
committer | Herman van Hovell <hvanhovell@databricks.com> | 2017-01-17 15:39:24 -0800 |
commit | 2992a0e79edcabf3b7434b566239e2a861bc99ea (patch) | |
tree | 269e3999db4bdb00071247bada382e3a6c207f2f /sql/hive/src/test/scala/org/apache | |
parent | 83dff87dedd66fcad13f1b54899c1c56ab1536b6 (diff) | |
download | spark-2992a0e79edcabf3b7434b566239e2a861bc99ea.tar.gz spark-2992a0e79edcabf3b7434b566239e2a861bc99ea.tar.bz2 spark-2992a0e79edcabf3b7434b566239e2a861bc99ea.zip |
[SPARK-13721][SQL] Support outer generators in DataFrame API
## What changes were proposed in this pull request?
Added outer_explode, outer_posexplode, outer_inline functions and expressions.
Some bug fixing in GenerateExec.scala for CollectionGenerator. Previously it was not correctly handling the case of outer with empty collections, only with nulls.
## How was this patch tested?
New tests added to GeneratorFunctionSuite
Author: Bogdan Raducanu <bogdan.rdc@gmail.com>
Closes #16608 from bogdanrdc/SPARK-13721.
Diffstat (limited to 'sql/hive/src/test/scala/org/apache')
-rw-r--r-- | sql/hive/src/test/scala/org/apache/spark/sql/catalyst/ExpressionToSQLSuite.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/catalyst/ExpressionToSQLSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/catalyst/ExpressionToSQLSuite.scala index 27ea167b90..df9390aec7 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/catalyst/ExpressionToSQLSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/catalyst/ExpressionToSQLSuite.scala @@ -93,6 +93,7 @@ class ExpressionToSQLSuite extends SQLBuilderTest with SQLTestUtils { checkSqlGeneration("SELECT array(1,2,3)") checkSqlGeneration("SELECT coalesce(null, 1, 2)") checkSqlGeneration("SELECT explode(array(1,2,3))") + checkSqlGeneration("SELECT explode_outer(array())") checkSqlGeneration("SELECT greatest(1,null,3)") checkSqlGeneration("SELECT if(1==2, 'yes', 'no')") checkSqlGeneration("SELECT isnan(15), isnan('invalid')") @@ -102,6 +103,8 @@ class ExpressionToSQLSuite extends SQLBuilderTest with SQLTestUtils { checkSqlGeneration("SELECT map(1, 'a', 2, 'b')") checkSqlGeneration("SELECT named_struct('c1',1,'c2',2,'c3',3)") checkSqlGeneration("SELECT nanvl(a, 5), nanvl(b, 10), nanvl(d, c) from t2") + checkSqlGeneration("SELECT posexplode_outer(array())") + checkSqlGeneration("SELECT inline_outer(array(struct('a', 1)))") checkSqlGeneration("SELECT rand(1)") checkSqlGeneration("SELECT randn(3)") checkSqlGeneration("SELECT struct(1,2,3)") |