GitHub user cloud-fan opened a pull request:
https://github.com/apache/spark/pull/19656
[SPARK-22445][SQL] move CodegenContext.copyResult to CodegenSupport
## What changes were proposed in this pull request?
`CodegenContext.copyResult` is kind of a global status for whole stage
codegen. But the tricky part is, it is only used to transfer an information
from child to parent when calling the `consume` chain. We have to be super
careful in `produce`/`consume`, to set it to true when producing multiple
result rows, and set it to false in operators that start new pipeline(like
sort).
This PR moves the `copyResult` to `CodegenSupport`, and call it at
`WholeStageCodegenExec`. This is much easier to reason about.
## How was this patch tested?
existing tests
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cloud-fan/spark whole-sage
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/19656.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #19656
----
commit 94beff0e229da4c5dd3cb3ddb677e5fe6e42499c
Author: Wenchen Fan <[email protected]>
Date: 2017-11-04T00:14:22Z
move CodegenContext.copyResult to CodegenSupport
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]