-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-32214][SQL] The type conversion function generated in makeFromJava for "other" type uses a wrong variable. #29029
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
| case udt: UserDefinedType[_] => makeFromJava(udt.sqlType) | ||
|
|
||
| case other => (obj: Any) => nullSafeConvert(other)(PartialFunction.empty) | ||
| case other => (obj: Any) => nullSafeConvert(obj)(PartialFunction.empty) |
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.
Hi, @sarutak . Can we have a test case for this?
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.
+1
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.
btw, for any input, this converter in this pattern returns null? I mean we cannot write it here like this?
case other => (_: Any) => null
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.
btw, for any input, this converter in this pattern returns null?
Yes so it's difficult to test based on the return value.
Or, how about testing that the converter still returns null, meaning there is no regression?
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.
either way seems fine to me
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.
I don't think there's any user-facing behaviour change after this fix .. let's clarify this is just a cleanup in the PR description.
HyukjinKwon
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.
LGTM
|
Test build #125261 has finished for PR 29029 at commit
|
|
I changed the PR description by myself. Merged to master, branch-3.0 and branch-2.4. |
…Java for "other" type uses a wrong variable ### What changes were proposed in this pull request? This PR fixes an inconsistency in `EvaluatePython.makeFromJava`, which creates a type conversion function for some Java/Scala types. `other` is a type but it should actually pass `obj`: ```scala case other => (obj: Any) => nullSafeConvert(other)(PartialFunction.empty) ``` This does not change the output because it always returns `null` for unsupported datatypes. ### Why are the changes needed? To make the codes coherent, and consistent. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? No behaviour change. Closes #29029 from sarutak/fix-makeFromJava. Authored-by: Kousuke Saruta <[email protected]> Signed-off-by: HyukjinKwon <[email protected]> (cherry picked from commit 371b35d) Signed-off-by: HyukjinKwon <[email protected]>
…Java for "other" type uses a wrong variable ### What changes were proposed in this pull request? This PR fixes an inconsistency in `EvaluatePython.makeFromJava`, which creates a type conversion function for some Java/Scala types. `other` is a type but it should actually pass `obj`: ```scala case other => (obj: Any) => nullSafeConvert(other)(PartialFunction.empty) ``` This does not change the output because it always returns `null` for unsupported datatypes. ### Why are the changes needed? To make the codes coherent, and consistent. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? No behaviour change. Closes #29029 from sarutak/fix-makeFromJava. Authored-by: Kousuke Saruta <[email protected]> Signed-off-by: HyukjinKwon <[email protected]> (cherry picked from commit 371b35d) Signed-off-by: HyukjinKwon <[email protected]>
|
@HyukjinKwon Thanks! |
What changes were proposed in this pull request?
This PR fixes an inconsistency in
EvaluatePython.makeFromJava, which creates a type conversion function for some Java/Scala types.otheris a type but it should actually passobj:This does not change the output because it always returns
nullfor unsupported datatypes.Why are the changes needed?
To make the codes coherent, and consistent.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
No behaviour change.