Skip to content

HIVE-29506: HiveRelDecorrelator fails to decorrelate plan with Values operator#6360

Open
kasakrisz wants to merge 2 commits intoapache:masterfrom
kasakrisz:HIVE-29506-master-decorrelate-values
Open

HIVE-29506: HiveRelDecorrelator fails to decorrelate plan with Values operator#6360
kasakrisz wants to merge 2 commits intoapache:masterfrom
kasakrisz:HIVE-29506-master-decorrelate-values

Conversation

@kasakrisz
Copy link
Contributor

@kasakrisz kasakrisz commented Mar 13, 2026

What changes were proposed in this pull request?

Remove the special handling of the Values operator from HiveRelDecorrelator

Why are the changes needed?

The specialization returned null, signaling the decorrelator algorithm to stop and return the original plan. Consequently, Correlate operators may remain in the plan, which Hive cannot handle.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

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

@kasakrisz kasakrisz force-pushed the HIVE-29506-master-decorrelate-values branch from c1e7433 to 3331420 Compare March 17, 2026 12:04
@kasakrisz kasakrisz marked this pull request as ready for review March 17, 2026 12:10
@sonarqubecloud
Copy link

-- To create a HiveValues operator before decorrelation automatic query rewrite with
-- materialized views is used.
-- All tables must be transactional to trigger automatic query rewrite.
create table mv_source (any_col int) stored as orc TBLPROPERTIES ('transactional'='true');
Copy link
Member

Choose a reason for hiding this comment

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

not sure we should be adding new tests with ACID table format, would it work with iceberg as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

The bug should occur when decorrelating any plan with a Values node. How about adding a unit test in a new class HiveRelDecorrelatorTest instead?

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.

4 participants