Skip to content

Conversation

@cloud-fan
Copy link
Contributor

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 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

@cloud-fan
Copy link
Contributor Author

cc @viirya

@SparkQA
Copy link

SparkQA commented Oct 31, 2018

Test build #98292 has finished for PR 22898 at commit 8266443.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@kiszk
Copy link
Member

kiszk commented Oct 31, 2018

retest this please

Copy link
Member

Choose a reason for hiding this comment

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

Good catch!

@viirya
Copy link
Member

viirya commented Oct 31, 2018

LGTM

@SparkQA
Copy link

SparkQA commented Oct 31, 2018

Test build #98302 has finished for PR 22898 at commit 8266443.

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

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch!

@SparkQA
Copy link

SparkQA commented Oct 31, 2018

Test build #98315 has finished for PR 22898 at commit 3101406.

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

@cloud-fan
Copy link
Contributor Author

thanks, merging to master!

@asfgit asfgit closed this in cd92f25 Nov 1, 2018
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

Closes apache#22898 from cloud-fan/minor.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants