Uh oh!
There was an error while loading. Please reload this page.
[SPARK-25746][SQL][followup] do not add unnecessary If expression - #22898
Closed
cloud-fan wants to merge 1 commit into
Closed
[SPARK-25746][SQL][followup] do not add unnecessary If expression#22898cloud-fan wants to merge 1 commit into
cloud-fan wants to merge 1 commit into
Conversation
cloud-fan
commented
Oct 31, 2018
ContributorAuthor
cc @viirya |
SparkQA
commented
Oct 31, 2018
Test build #98292 has finished for PR 22898 at commit
|
kiszk
commented
Oct 31, 2018
Member
retest this please |
viirya
reviewed
Oct 31, 2018
viirya
commented
Oct 31, 2018
Member
LGTM |
SparkQA
commented
Oct 31, 2018
Test build #98302 has finished for PR 22898 at commit
|
viirya
reviewed
Oct 31, 2018
Member
There was a problem hiding this comment.
oh, I see. If the child deserializer is a tuple deserializer, it is just
valdeserializer=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.
SparkQA
commented
Oct 31, 2018
Test build #98315 has finished for PR 22898 at commit
|
cloud-fan
commented
Nov 1, 2018
ContributorAuthor
thanks, merging to master! |
jackylee-ch pushed a commit
to jackylee-ch/spark
that referenced
this pull request
Feb 18, 2019
## 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 Closesapache#22898 from cloud-fan/minor. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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