diff options
author | Davies Liu <davies@databricks.com> | 2016-09-12 16:35:42 -0700 |
---|---|---|
committer | Davies Liu <davies.liu@gmail.com> | 2016-09-12 16:35:42 -0700 |
commit | a91ab705e8c124aa116c3e5b1f3ba88ce832dcde (patch) | |
tree | ec4c202b2f8ab704a2ce1058ade1aeb2d91af0f4 /sql/core/src/test | |
parent | f9c580f11098d95f098936a0b90fa21d71021205 (diff) | |
download | spark-a91ab705e8c124aa116c3e5b1f3ba88ce832dcde.tar.gz spark-a91ab705e8c124aa116c3e5b1f3ba88ce832dcde.tar.bz2 spark-a91ab705e8c124aa116c3e5b1f3ba88ce832dcde.zip |
[SPARK-17474] [SQL] fix python udf in TakeOrderedAndProjectExec
## What changes were proposed in this pull request?
When there is any Python UDF in the Project between Sort and Limit, it will be collected into TakeOrderedAndProjectExec, ExtractPythonUDFs failed to pull the Python UDFs out because QueryPlan.expressions does not include the expression inside Option[Seq[Expression]].
Ideally, we should fix the `QueryPlan.expressions`, but tried with no luck (it always run into infinite loop). In PR, I changed the TakeOrderedAndProjectExec to no use Option[Seq[Expression]] to workaround it. cc JoshRosen
## How was this patch tested?
Added regression test.
Author: Davies Liu <davies@databricks.com>
Closes #15030 from davies/all_expr.
Diffstat (limited to 'sql/core/src/test')
-rw-r--r-- | sql/core/src/test/scala/org/apache/spark/sql/execution/TakeOrderedAndProjectSuite.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/TakeOrderedAndProjectSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/TakeOrderedAndProjectSuite.scala index 3217e34bd8..7e317a4d80 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/TakeOrderedAndProjectSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/TakeOrderedAndProjectSuite.scala @@ -59,7 +59,7 @@ class TakeOrderedAndProjectSuite extends SparkPlanTest with SharedSQLContext { checkThatPlansAgree( generateRandomInputData(), input => - noOpFilter(TakeOrderedAndProjectExec(limit, sortOrder, None, input)), + noOpFilter(TakeOrderedAndProjectExec(limit, sortOrder, input.output, input)), input => GlobalLimitExec(limit, LocalLimitExec(limit, @@ -74,7 +74,7 @@ class TakeOrderedAndProjectSuite extends SparkPlanTest with SharedSQLContext { generateRandomInputData(), input => noOpFilter( - TakeOrderedAndProjectExec(limit, sortOrder, Some(Seq(input.output.last)), input)), + TakeOrderedAndProjectExec(limit, sortOrder, Seq(input.output.last), input)), input => GlobalLimitExec(limit, LocalLimitExec(limit, |