zabetak opened a new pull request, #5583: URL: https://github.com/apache/hive/pull/5583
### What changes were proposed in this pull request? 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 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" ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org