Skip to content
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

[SPARK-32819][SQL][3.0] ignoreNullability parameter should be effective recursively #29705

Closed
wants to merge 1 commit into from

Conversation

viirya
Copy link
Member

@viirya viirya commented Sep 10, 2020

What changes were proposed in this pull request?

This patch proposes to check ignoreNullability parameter recursively in equalsStructurally method. This backports #29698 to branch-3.0.

Why are the changes needed?

equalsStructurally is used to check type equality. We can optionally ask to ignore nullability check. But the parameter ignoreNullability is not passed recursively down to nested types. So it produces weird error like:

data type mismatch: argument 3 requires array<array<string>> type, however ... is of array<array<string>> type.

when running the query select aggregate(split('abcdefgh',''), array(array('')), (acc, x) -> array(array( x ) ) ).

Does this PR introduce any user-facing change?

Yes, fixed a bug when running user query.

How was this patch tested?

Unit tests.

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

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

Looks good pending tests.

@SparkQA
Copy link

SparkQA commented Sep 10, 2020

Test build #128488 has finished for PR 29705 at commit fd176a7.

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

@HyukjinKwon
Copy link
Member

Merged to branch-3.0. GitHub Actions build passed.

HyukjinKwon pushed a commit that referenced this pull request Sep 10, 2020
…ve recursively

### What changes were proposed in this pull request?

This patch proposes to check `ignoreNullability` parameter recursively in `equalsStructurally` method. This backports #29698 to branch-3.0.

### Why are the changes needed?

`equalsStructurally` is used to check type equality. We can optionally ask to ignore nullability check. But the parameter `ignoreNullability` is not passed recursively down to nested types. So it produces weird error like:

```
data type mismatch: argument 3 requires array<array<string>> type, however ... is of array<array<string>> type.
```

when running the query `select aggregate(split('abcdefgh',''), array(array('')), (acc, x) -> array(array( x ) ) )`.

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

Yes, fixed a bug when running user query.

### How was this patch tested?

Unit tests.

Closes #29705 from viirya/SPARK-32819-3.0.

Authored-by: Liang-Chi Hsieh <viirya@gmail.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
@viirya
Copy link
Member Author

viirya commented Sep 10, 2020

Thanks!

holdenk pushed a commit to holdenk/spark that referenced this pull request Oct 27, 2020
…ve recursively

### What changes were proposed in this pull request?

This patch proposes to check `ignoreNullability` parameter recursively in `equalsStructurally` method. This backports apache#29698 to branch-3.0.

### Why are the changes needed?

`equalsStructurally` is used to check type equality. We can optionally ask to ignore nullability check. But the parameter `ignoreNullability` is not passed recursively down to nested types. So it produces weird error like:

```
data type mismatch: argument 3 requires array<array<string>> type, however ... is of array<array<string>> type.
```

when running the query `select aggregate(split('abcdefgh',''), array(array('')), (acc, x) -> array(array( x ) ) )`.

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

Yes, fixed a bug when running user query.

### How was this patch tested?

Unit tests.

Closes apache#29705 from viirya/SPARK-32819-3.0.

Authored-by: Liang-Chi Hsieh <viirya@gmail.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
@viirya viirya deleted the SPARK-32819-3.0 branch December 27, 2023 18:24
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.

4 participants