-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-28321][SQL] 0-args Java UDF should not be called only once #25108
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
|
cc @cloud-fan |
|
good catch! LGTM |
|
Test build #107507 has finished for PR 25108 at commit
|
|
retest this please |
viirya
left a comment
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.
Good catch!
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.
This one, I manually tested but didn't add the test just in case we want to add some kind of optimization in the future. We shouldn't do such thing here but in optimizer anyway. Seems like just a mistake.
|
Test build #107517 has finished for PR 25108 at commit
|
sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala
Outdated
Show resolved
Hide resolved
|
Test build #107529 has finished for PR 25108 at commit
|
srowen
left a comment
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.
Seems OK, though I don't know enough to really review.
|
Test build #107536 has finished for PR 25108 at commit
|
|
thanks, merging to master! |
## What changes were proposed in this pull request? 0-args Java UDF alone calls the function even before making it as an expression. It causes that the function always returns the same value and the function is called at driver side. Seems like a mistake. ## How was this patch tested? Unit test was added Closes apache#25108 from HyukjinKwon/SPARK-28321. Authored-by: HyukjinKwon <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
|
This a nice fix, but we still need to document it in the migration guide. This changes a behavior. Also it could cause a perf regression when calling the 0-args Java UDF is expensive. |
|
Yea, that's fine. Let me update the migration guide. |
…UDF's internal behaviour change ## What changes were proposed in this pull request? This PR proposes to add a note in the migration guide. See apache#25108 (comment) ## How was this patch tested? N/A Closes apache#25224 from HyukjinKwon/SPARK-28321-doc. Lead-authored-by: HyukjinKwon <[email protected]> Co-authored-by: Hyukjin Kwon <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
What changes were proposed in this pull request?
0-args Java UDF alone calls the function even before making it as an expression.
It causes that the function always returns the same value and the function is called at driver side.
Seems like a mistake.
How was this patch tested?
Unit test was added