-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-23823][SQL] Keep origin in transformExpression #20961
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
Conversation
Fixes https://issues.apache.org/jira/browse/SPARK-23823 Keep origin for all the methods using transformExpression
|
ok to test |
|
Test build #88831 has finished for PR 20961 at commit
|
|
|
||
| @inline def transformExpression(e: Expression): Expression = { | ||
| val newE = f(e) | ||
| val newE = CurrentOrigin.withOrigin(e.origin) { f(e) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: style issue:
val newE = CurrentOrigin.withOrigin(e.origin) {
f(e)
}|
This sounds right to me. cc @hvanhovell @cloud-fan |
|
LGTM, too |
|
@gatorsmile fixed :D |
|
Can you add a test? Just show that origin is still the same after you transform the node. |
|
Test build #88890 has finished for PR 20961 at commit
|
|
@hvanhovell added a test, before this change the origin would be undefined |
|
Test build #88909 has finished for PR 20961 at commit
|
|
retest this please |
|
Test build #88945 has finished for PR 20961 at commit
|
|
retest this please |
|
|
||
| class QueryPlanSuite extends SparkFunSuite { | ||
|
|
||
| test("origin remains the same after mapExpressions") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is it better to add JIRA number (i.e. SPARK-PARK-23823: ...)
|
@kiszk Added the ticket number! Do we need to retrigger the test build on that new commit? |
|
Test build #88954 has finished for PR 20961 at commit
|
|
Test build #88952 has finished for PR 20961 at commit
|
|
Don't know why it failed so many times... but all these tests pass on my local machine and the commit before adding the test... |
|
retest this please |
|
Test build #88957 has finished for PR 20961 at commit
|
|
Thanks! Merged to master/2.3 |
Fixes https://issues.apache.org/jira/browse/SPARK-23823 Keep origin for all the methods using transformExpression ## What changes were proposed in this pull request? Keep origin in transformExpression ## How was this patch tested? Manually tested that this fixes https://issues.apache.org/jira/browse/SPARK-23823 and columns have correct origins after Analyzer.analyze Author: JiahuiJiang <[email protected]> Author: Jiahui Jiang <[email protected]> Closes #20961 from JiahuiJiang/jj/keep-origin. (cherry picked from commit d65e531) Signed-off-by: gatorsmile <[email protected]>
Fixes https://issues.apache.org/jira/browse/SPARK-23823 Keep origin for all the methods using transformExpression ## What changes were proposed in this pull request? Keep origin in transformExpression ## How was this patch tested? Manually tested that this fixes https://issues.apache.org/jira/browse/SPARK-23823 and columns have correct origins after Analyzer.analyze Author: JiahuiJiang <[email protected]> Author: Jiahui Jiang <[email protected]> Closes apache#20961 from JiahuiJiang/jj/keep-origin.
Fixes https://issues.apache.org/jira/browse/SPARK-23823 Keep origin for all the methods using transformExpression Keep origin in transformExpression Manually tested that this fixes https://issues.apache.org/jira/browse/SPARK-23823 and columns have correct origins after Analyzer.analyze Author: JiahuiJiang <[email protected]> Author: Jiahui Jiang <[email protected]> Closes apache#20961 from JiahuiJiang/jj/keep-origin. (cherry picked from commit d65e531) Signed-off-by: gatorsmile <[email protected]> Change-Id: I6cd7636a051144f5eb2d079f141ae69616dcad7e
Fixes https://issues.apache.org/jira/browse/SPARK-23823
Keep origin for all the methods using transformExpression
What changes were proposed in this pull request?
Keep origin in transformExpression
How was this patch tested?
Manually tested that this fixes https://issues.apache.org/jira/browse/SPARK-23823 and columns have correct origins after Analyzer.analyze