Skip to content

Conversation

@allisonwang-db
Copy link
Contributor

@allisonwang-db allisonwang-db commented Apr 27, 2022

What changes were proposed in this pull request?

Backport #36216 to branch-3.0.

Why are the changes needed?

To fix a bug in SchemaPruning.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Unit test

… that do not belong to the current relation

This PR updates `ProjectionOverSchema`  to use the outputs of the data source relation to filter the attributes in the nested schema pruning. This is needed because the attributes in the schema do not necessarily belong to the current data source relation. For example, if a filter contains a correlated subquery, then the subquery's children can contain attributes from both the inner query and the outer query. Since the `RewriteSubquery` batch happens after early scan pushdown rules, nested schema pruning can wrongly use the inner query's attributes to prune the outer query data schema, thus causing wrong results and unexpected exceptions.

To fix a bug in `SchemaPruning`.

No

Unit test

Closes apache#36216 from allisonwang-db/spark-38918-nested-column-pruning.

Authored-by: allisonwang-db <[email protected]>
Signed-off-by: Liang-Chi Hsieh <[email protected]>
(cherry picked from commit 150434b)
Signed-off-by: Liang-Chi Hsieh <[email protected]>
(cherry picked from commit 793ba60)
Signed-off-by: allisonwang-db <[email protected]>
@viirya
Copy link
Member

viirya commented May 1, 2022

Thanks. Merging to 3.0.

viirya pushed a commit that referenced this pull request May 1, 2022
…butes that do not belong to the current relation

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

Backport #36216 to branch-3.0.

### Why are the changes needed?

To fix a bug in `SchemaPruning`.

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

No

### How was this patch tested?

Unit test

Closes #36388 from allisonwang-db/spark-38918-branch-3.0.

Authored-by: allisonwang-db <[email protected]>
Signed-off-by: Liang-Chi Hsieh <[email protected]>
@viirya viirya closed this May 1, 2022
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.

2 participants