-
Notifications
You must be signed in to change notification settings - Fork 28.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-13838][SQL] Clear variable code to prevent it to be re-evaluated in BoundAttribute #11674
Conversation
cc @davies |
Test build #52995 has finished for PR 11674 at commit
|
cc @davies This is tiny. Do you think this is useful? |
LGTM, merging into master. |
…ted in BoundAttribute JIRA: https://issues.apache.org/jira/browse/SPARK-13838 ## What changes were proposed in this pull request? We should also clear the variable code in `BoundReference.genCode` to prevent it to be evaluated twice, as we did in `evaluateVariables`. ## How was this patch tested? Existing tests. Author: Liang-Chi Hsieh <simonh@tw.ibm.com> Closes apache#11674 from viirya/avoid-reevaluate.
who will re-evaluate |
If one variable is used as input to many expressions? |
for example, |
It is correct that we should always evaluate the used variables before generating expression codes. The variables' codes are clear and won't be evaluated twice. Here this is a safety guard that prevents possible missing, I think. |
It's different from |
Ok. I think it should be safe to revert this. |
Thanks! Since it's a small change, we can do it in future whole-stage-codegen-related PRs. |
Oh. I see. After looking at the source file at that time: The After iterations of revamping, this is not anymore. |
JIRA: https://issues.apache.org/jira/browse/SPARK-13838
What changes were proposed in this pull request?
We should also clear the variable code in
BoundReference.genCode
to prevent it to be evaluated twice, as we did inevaluateVariables
.How was this patch tested?
Existing tests.