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-28582: OOM when compiling query with many GROUP BY columns aliased multiple times #5583

Closed
wants to merge 1 commit into from

Conversation

zabetak
Copy link
Member

@zabetak zabetak commented Dec 19, 2024

What changes were proposed in this pull request?

Copy RelMdUniqueKeys#getProjectUniqueKeys to HiveRelMdUniqueKeys handler to overcome the OOM till we upgrade to a Calcite version with the necessary fixes. The copy is almost exact minus a small adaptation in Util#transform that transforms the colMask bitset to a list.

Why are the changes needed?

The RelMdUniqueKeys handler has some logic that leads to an exponential increase of results (unique keys) when certain query/plan patterns appear. The problem has been addressed by CALCITE-6640 and CALCITE-6704 but those are not available in current Calcite version.

For more details see HIVE-28582.

Does this PR introduce any user-facing change?

No

Is the change a dependency upgrade?

No

How was this patch tested?

mvn test -Dtest=TestMiniLlapLocalCliDriver.java -Dqfile="cbo_unique_keys_oom.q"

@zabetak
Copy link
Member Author

zabetak commented Jan 2, 2025

The test failures in groupby_join_pushdown.q.out are due to HIVE-28675. Once HIVE-28675 gets in the changes will no longer appear.

…ed multiple times

The RelMdUniqueKeys handler has some logic that leads to an exponential increase of results (unique keys) when certain query/plan patterns appear.
The problem has been addressed by CALCITE-6640 and CALCITE-6704 but those are not available in current Calcite version.

Copy RelMdUniqueKeys#getProjectUniqueKeys
(https://github.com/apache/calcite/blob/648a832e0b3abc0f1cd4887847bdef7c133cb383/core/src/main/java/org/apache/calcite/rel/metadata/RelMdUniqueKeys.java#L162)
to HiveRelMdUniqueKeys handler to overcome the OOM till we upgrade to a Calcite version with the afforementioned fixes.
The copy is almost exact minus a small adaptation in Util#transform that transforms the colMask bitset to a list.
Copy link

sonarqubecloud bot commented Jan 6, 2025

@zabetak zabetak closed this in 5ffcdb7 Jan 7, 2025
@zabetak zabetak deleted the HIVE-28582 branch January 7, 2025 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants