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

HIVE-26160: Materialized View rewrite does not check tables scanned in sub-query expressions #3246

Merged
merged 1 commit into from Apr 28, 2022

Conversation

kasakrisz
Copy link
Contributor

What changes were proposed in this pull request?

Temporary apply the HiveSubQueryRemoveRule before collecting tables scanned by the initial CBO plan when performing sql text based MV rewrite.

Why are the changes needed?

For Materialized View rewrite based on exact sql text match Hive uses the initial CBO plan which may contains sub-query expressions but the algorithm traverse the plan and collects the tables can not handle sub-query expressions.

Does this PR introduce any user-facing change?

Yes. If a query plan was rewritten to scan an outdated MV the results can be different.

How was this patch tested?

mvn test -Dtest.output.overwrite -DskipSparkTests -Dtest=TestMiniLlapLocalCliDriver -Dqfile=materialized_view_rewrite_by_text_9.q -pl itests/qtest -Pitests

@kasakrisz kasakrisz requested a review from zabetak April 27, 2022 14:10
@kasakrisz kasakrisz merged commit 192a9a9 into apache:master Apr 28, 2022
@kasakrisz kasakrisz deleted the HIVE-26160-master-tables-used-v2 branch April 28, 2022 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants