-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-25746][SQL][followup] do not add unnecessary If expression #22898
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 @viirya |
|
Test build #98292 has finished for PR 22898 at commit
|
|
retest this please |
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!
|
LGTM |
|
Test build #98302 has finished for PR 22898 at commit
|
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.
oh, I see. If the child deserializer is a tuple deserializer, it is just
val deserializer =
NewInstance(cls, childrenDeserializers, ObjectType(cls), propagateNull = false)So it misses the If(IsNull(..), null, ...) pattern. We should wrap the NewInstance with If(IsNull(..), null) at L139.
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!
|
Test build #98315 has finished for PR 22898 at commit
|
|
thanks, merging to master! |
## What changes were proposed in this pull request? a followup of apache#22749. When we construct the new serializer in `ExpressionEncoder.tuple`, we don't need to add `if(isnull ...)` check for each field. They are either simple expressions that can propagate null correctly(e.g. `GetStructField(GetColumnByOrdinal(0, schema), index)`), or complex expression that already have the isnull check. ## How was this patch tested? existing tests Closes apache#22898 from cloud-fan/minor. Authored-by: Wenchen Fan <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
What changes were proposed in this pull request?
a followup of #22749.
When we construct the new serializer in
ExpressionEncoder.tuple, we don't need to addif(isnull ...)check for each field. They are either simple expressions that can propagate null correctly(e.g.GetStructField(GetColumnByOrdinal(0, schema), index)), or complex expression that already have the isnull check.How was this patch tested?
existing tests