Skip to content
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-35347][SQL] Use MethodUtils for looking up methods in Invoke and StaticInvoke #32474

Closed
wants to merge 1 commit into from

Conversation

viirya
Copy link
Member

@viirya viirya commented May 8, 2021

What changes were proposed in this pull request?

This patch proposes to use MethodUtils for looking up methods Invoke and StaticInvoke expressions.

Why are the changes needed?

Currently we wrote our logic in Invoke and StaticInvoke expressions for looking up methods. It is tricky to consider all the cases and there is already existing utility package for this purpose. We should reuse the utility package.

Does this PR introduce any user-facing change?

No, internal change only.

How was this patch tested?

Existing tests.

@github-actions github-actions bot added the SQL label May 8, 2021
@SparkQA
Copy link

SparkQA commented May 8, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42802/

@SparkQA
Copy link

SparkQA commented May 8, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42802/

@SparkQA
Copy link

SparkQA commented May 8, 2021

Test build #138280 has finished for PR 32474 at commit 7b96cb2.

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

} else {
m.head
}
val method = MethodUtils.getMatchingAccessibleMethod(cls, functionName, argClasses: _*)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, this has more code like setAccessibleWorkaround. Let's trigger JDK11 test.

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-35347][SQL] Use MethodUtils for looking up methods in Invoke and StaticInvoke [SPARK-35347][SQL][test-java11] Use MethodUtils for looking up methods in Invoke and StaticInvoke May 8, 2021
@dongjoon-hyun
Copy link
Member

Retest this please

@SparkQA
Copy link

SparkQA commented May 8, 2021

Test build #138291 has finished for PR 32474 at commit 7b96cb2.

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

@SparkQA
Copy link

SparkQA commented May 8, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42813/

@SparkQA
Copy link

SparkQA commented May 8, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42813/

@viirya
Copy link
Member Author

viirya commented May 8, 2021

retest this please

@SparkQA
Copy link

SparkQA commented May 8, 2021

Test build #138297 has finished for PR 32474 at commit 7b96cb2.

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

@viirya
Copy link
Member Author

viirya commented May 8, 2021

[error] java.io.IOException: Cannot run program "/usr/java/jdk-11.0.1/bin/java" (in directory "/home/jenkins/workspace/SparkPullRequestBuilder/sql/hive-thriftserver"): error=2, No such file or directory

Seems something is wrong with Jenkins?

@SparkQA
Copy link

SparkQA commented May 8, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42819/

@SparkQA
Copy link

SparkQA commented May 8, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42819/

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented May 8, 2021

[error] java.io.IOException: Cannot run program "/usr/java/jdk-11.0.1/bin/java" (in directory "/home/jenkins/workspace/SparkPullRequestBuilder/sql/hive-thriftserver"): error=2, No such file or directory

Seems something is wrong with Jenkins?

Oh, it seems that UCB Amplab Jenkins lab still didn't finish the setup. In that case, let's ignore Jenkins.

  1. Please re-trigger your GitHub Action. It also failing at Java11 compilation. In this case, it looks like a flaky issue.

Screen Shot 2021-05-08 at 1 19 15 PM

  1. If you don't mind, please run catalyst module with JDK11 and share the result with us, @viirya .

After transition to run in yours' fork, only the author can re-trigger it.

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-35347][SQL][test-java11] Use MethodUtils for looking up methods in Invoke and StaticInvoke [SPARK-35347][SQL] Use MethodUtils for looking up methods in Invoke and StaticInvoke May 8, 2021
@viirya
Copy link
Member Author

viirya commented May 8, 2021

Thanks @dongjoon-hyun. Re-triggered GA and the Java 11 build was passed.

@dongjoon-hyun
Copy link
Member

Thanks. And, did you run catalyst test with Java 11 locally?

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented May 8, 2021

I tested it.

[info] All tests passed.
[info] Passed: Total 5175, Failed 0, Errors 0, Passed 5175, Ignored 5, Canceled 1
[success] Total time: 552 s (09:12), completed May 8, 2021, 3:15:52 PM
build/sbt "catalyst/test"  2423.75s user 77.89s system 432% cpu 9:38.15 total

SPARK-PR-32474:SPARK-PR-32474 $ java -version
openjdk version "11.0.11" 2021-04-20 LTS

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM. Merged to master for Apache Spark 3.2.0. Thank you, @viirya .

@viirya
Copy link
Member Author

viirya commented May 8, 2021

Thank you @dongjoon-hyun!

@viirya viirya deleted the invoke-util branch May 8, 2021 23:38
}
val method = MethodUtils.getMatchingAccessibleMethod(cls, functionName, argClasses: _*)
if (method == null) {
sys.error(s"Couldn't find $functionName on $cls")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we throw an exception to only fail the query, instead of sys.error which crashes the driver JVM?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will submit a follow-up.

viirya added a commit that referenced this pull request May 12, 2021
…on type when cannot find the method instead of sys.error

### What changes were proposed in this pull request?

A simple follow-up of #32474 to throw exception instead of sys.error.

### Why are the changes needed?

An exception only fails the query, instead of sys.error.

### Does this PR introduce _any_ user-facing change?

Yes, if `Invoke` or `StaticInvoke` cannot find the method, instead of original `sys.error` now we only throw an exception.

### How was this patch tested?

Existing tests.

Closes #32519 from viirya/SPARK-35347-followup.

Authored-by: Liang-Chi Hsieh <[email protected]>
Signed-off-by: Liang-Chi Hsieh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants