Skip to content

Conversation

@jiahuijiang
Copy link

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

@gatorsmile
Copy link
Member

ok to test

@SparkQA
Copy link

SparkQA commented Apr 3, 2018

Test build #88831 has finished for PR 20961 at commit 5e83805.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.


@inline def transformExpression(e: Expression): Expression = {
val newE = f(e)
val newE = CurrentOrigin.withOrigin(e.origin) { f(e) }
Copy link
Member

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)
      }

@gatorsmile
Copy link
Member

This sounds right to me. cc @hvanhovell @cloud-fan

@cloud-fan
Copy link
Contributor

LGTM, too

@jiahuijiang
Copy link
Author

@gatorsmile fixed :D

@hvanhovell
Copy link
Contributor

Can you add a test? Just show that origin is still the same after you transform the node.

@SparkQA
Copy link

SparkQA commented Apr 4, 2018

Test build #88890 has finished for PR 20961 at commit 8396dbb.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@jiahuijiang
Copy link
Author

@hvanhovell added a test, before this change the origin would be undefined

@SparkQA
Copy link

SparkQA commented Apr 5, 2018

Test build #88909 has finished for PR 20961 at commit 52e8875.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class QueryPlanSuite extends SparkFunSuite

@cloud-fan
Copy link
Contributor

retest this please

@SparkQA
Copy link

SparkQA commented Apr 5, 2018

Test build #88945 has finished for PR 20961 at commit 52e8875.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class QueryPlanSuite extends SparkFunSuite

@kiszk
Copy link
Member

kiszk commented Apr 5, 2018

retest this please


class QueryPlanSuite extends SparkFunSuite {

test("origin remains the same after mapExpressions") {
Copy link
Member

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: ...)

@jiahuijiang
Copy link
Author

@kiszk Added the ticket number! Do we need to retrigger the test build on that new commit?

@SparkQA
Copy link

SparkQA commented Apr 5, 2018

Test build #88954 has finished for PR 20961 at commit a1c029c.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 5, 2018

Test build #88952 has finished for PR 20961 at commit 52e8875.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class QueryPlanSuite extends SparkFunSuite

@jiahuijiang
Copy link
Author

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...

@gatorsmile
Copy link
Member

retest this please

@SparkQA
Copy link

SparkQA commented Apr 6, 2018

Test build #88957 has finished for PR 20961 at commit a1c029c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gatorsmile
Copy link
Member

Thanks! Merged to master/2.3

@asfgit asfgit closed this in d65e531 Apr 6, 2018
asfgit pushed a commit that referenced this pull request Apr 6, 2018
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]>
robert3005 pushed a commit to palantir/spark that referenced this pull request Apr 7, 2018
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.
peter-toth pushed a commit to peter-toth/spark that referenced this pull request Oct 6, 2018
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants