Uh oh!
There was an error while loading. Please reload this page.
[SPARK-13636][SQL] Directly consume UnsafeRow in wholestage codegen plans - #11484
[SPARK-13636][SQL] Directly consume UnsafeRow in wholestage codegen plans#11484viirya wants to merge 7 commits into
Conversation
viirya
commented
Mar 3, 2016
Before this patch, the generated codes for the Sort operator in the plan |
viirya
commented
Mar 3, 2016
After this patch, the generated codes: |
viirya
commented
Mar 3, 2016
You can find that in the method |
SparkQA
commented
Mar 3, 2016
Test build #52367 has finished for PR 11484 at commit
|
viirya
commented
Mar 3, 2016
retest this please. |
SparkQA
commented
Mar 3, 2016
Test build #52377 has finished for PR 11484 at commit
|
viirya
commented
Mar 4, 2016
| protected var parent: CodegenSupport = null | ||
| /** | ||
| * Whether this SparkPlan accepts UnsafeRow as input in consumeChild. |
davies
commented
Mar 4, 2016
viirya
commented
Mar 4, 2016
@davies Yea. That will be good. |
kiszk
commented
Mar 4, 2016
Is it better to add "in sort" in a title of this PR? |
viirya
commented
Mar 4, 2016
@kiszk this is not just for Sort operator. I just take Sort operator as an example. |
kiszk
commented
Mar 4, 2016
@viirya thank you for your explanation. I understood that this PR supports sort and operations regarding whole stage code generation |
…saferow Conflicts: sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegen.scala sql/core/src/main/scala/org/apache/spark/sql/execution/basicOperators.scala
SparkQA
commented
Mar 9, 2016
Test build #52733 has finished for PR 11484 at commit
|
SparkQA
commented
Mar 9, 2016
Test build #52732 has finished for PR 11484 at commit
|
viirya
commented
Mar 9, 2016
| } | ||
| override def doConsume(ctx: CodegenContext, input: Seq[ExprCode], row: String): String = { | ||
| if (row != null) { | ||
| s"$sorterVariable.insertRow((UnsafeRow)$row.copy());" |
There was a problem hiding this comment.
Do we need the copy here? I think the sorter will copy it by itself.
There was a problem hiding this comment.
Yes. I checked it. Will remove this copy call.
JIRA: https://issues.apache.org/jira/browse/SPARK-13636
What changes were proposed in this pull request?
As shown in the wholestage codegen verion of Sort operator, when Sort is top of Exchange (or other operator that produce UnsafeRow), we will create variables from UnsafeRow, than create another UnsafeRow using these variables. We should avoid the unnecessary unpack and pack variables from UnsafeRows.
How was this patch tested?
All existing wholestage codegen tests should be passed.