Skip to content

[SPARK-32652][SQL] ObjectSerializerPruning fails for RowEncoder#29467

Closed
cloud-fan wants to merge 1 commit intoapache:masterfrom
cloud-fan:bug
Closed

[SPARK-32652][SQL] ObjectSerializerPruning fails for RowEncoder#29467
cloud-fan wants to merge 1 commit intoapache:masterfrom
cloud-fan:bug

Conversation

@cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

Update ObjectSerializerPruning.alignNullTypeInIf, to consider the isNull check generated in RowEncoder, which is Invoke(inputObject, "isNullAt", BooleanType, Literal(index) :: Nil).

Why are the changes needed?

Query fails if we don't fix this bug, due to type mismatch in If.

Does this PR introduce any user-facing change?

Yes, the failed query can run after this fix.

How was this patch tested?

new tests

@cloud-fan
Copy link
Contributor Author

cc @viirya @maropu @dongjoon-hyun

@dongjoon-hyun
Copy link
Member

Thank you for pinging me, @cloud-fan .

Copy link
Member

@viirya viirya left a comment

Choose a reason for hiding this comment

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

lgtm, thanks for fixing this.

Comment on lines +132 to +133
// `name` in `GetStructField` affects `comparePlans`. Maybe we can ignore
// `name` in `GetStructField.equals`?
Copy link
Member

Choose a reason for hiding this comment

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

Sounds good. When we compare GetStructField semantically, name is actually ignored.

Copy link
Member

@maropu maropu Aug 19, 2020

Choose a reason for hiding this comment

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

+1. Could we remove this comment and file jira for this issue before merging?

Copy link
Member

Choose a reason for hiding this comment

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

Let me just merge this. In the PR that actually ignores the equality, we can remove this comment and also the codes clearing the name below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I just copied this comment from the existing test case above. If we can fix it, we should remove comments from both test cases.

@SparkQA
Copy link

SparkQA commented Aug 18, 2020

Test build #127589 has finished for PR 29467 at commit 7799581.

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

@HyukjinKwon
Copy link
Member

Merged to master and branch-3.0.

HyukjinKwon pushed a commit that referenced this pull request Aug 19, 2020
### What changes were proposed in this pull request?

Update `ObjectSerializerPruning.alignNullTypeInIf`, to consider the isNull check generated in `RowEncoder`, which is `Invoke(inputObject, "isNullAt", BooleanType, Literal(index) :: Nil)`.

### Why are the changes needed?

Query fails if we don't fix this bug, due to type mismatch in `If`.

### Does this PR introduce _any_ user-facing change?

Yes, the failed query can run after this fix.

### How was this patch tested?

new tests

Closes #29467 from cloud-fan/bug.

Authored-by: Wenchen Fan <wenchen@databricks.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
(cherry picked from commit f33b64a)
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Comments