Uh oh!
There was an error while loading. Please reload this page.
[SPARK-17474] [SQL] fix python udf in TakeOrderedAndProjectExec - #15030
Closed
davies wants to merge 3 commits into
Closed
[SPARK-17474] [SQL] fix python udf in TakeOrderedAndProjectExec#15030davies wants to merge 3 commits into
davies wants to merge 3 commits into
Conversation
SparkQA
commented
Sep 9, 2016
Test build #65161 has finished for PR 15030 at commit
|
JoshRosen
commented
Sep 9, 2016
Contributor
|
SparkQA
commented
Sep 9, 2016
Test build #65167 has finished for PR 15030 at commit
|
| val topK = org.apache.spark.util.collection.Utils.takeOrdered(iter.map(_.copy()), limit)(ord) | ||
| if (projectList.isDefined) { | ||
| val proj = UnsafeProjection.create(projectList.get, child.output) | ||
| if (AttributeSet(projectList) != child.outputSet) { |
Contributor
There was a problem hiding this comment.
Should this be order-insensitive, set-based comparision or should it be using AttributeSeq instead? I'm wondering whether we could hit a bug in case the project happens to permute the child output columns, since in that case I think we'd end up skipping the final column-reordering projection.
ContributorAuthor
There was a problem hiding this comment.
Good point, we should just compare it with output as Seq directly.
SparkQA
commented
Sep 12, 2016
Test build #65273 has finished for PR 15030 at commit
|
JoshRosen
commented
Sep 12, 2016
Contributor
LGTM |
davies
commented
Sep 12, 2016
ContributorAuthor
Merging into 2.0 and master. |
asfgit pushed a commit
that referenced
this pull request
Sep 12, 2016
## 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. (cherry picked from commit a91ab70) Signed-off-by: Davies Liu <davies.liu@gmail.com>
wgtmac pushed a commit
to wgtmac/spark
that referenced
this pull request
Sep 19, 2016
## 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> Closesapache#15030 from davies/all_expr.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 @JoshRosenHow was this patch tested?
Added regression test.