Skip to content

HIVE-29496: Subsequent transactional materialized view rebuild fails when source tables are iceberg tables#6434

Open
kasakrisz wants to merge 1 commit intoapache:masterfrom
kasakrisz:HIVE-29496-master-acid-mv-lock
Open

HIVE-29496: Subsequent transactional materialized view rebuild fails when source tables are iceberg tables#6434
kasakrisz wants to merge 1 commit intoapache:masterfrom
kasakrisz:HIVE-29496-master-acid-mv-lock

Conversation

@kasakrisz
Copy link
Copy Markdown
Contributor

@kasakrisz kasakrisz commented Apr 15, 2026

What changes were proposed in this pull request?

Move the lock acquisition for materialized view rebuilds to after the Hive operator plan generation.

Why are the changes needed?

Before plan generation, the current transaction ID defaults to 0, and this value is passed to the lock acquisition request. This prevents the subsequent rebuild of transactional MVs when the source tables are Iceberg.

The transaction ID is set during the Hive operator tree generation, specifically during FS operator creation. When source tables are ACID-compliant, the transaction ID is set before the rebuild plan is generated; therefore, this scenario remains unaffected."

Does this PR introduce any user-facing change?

No.

How was this patch tested?

mvn test -Dtest.output.overwrite -Dtest=TestIcebergLlapLocalCliDriver -Dqfile=mv_iceberg_orc9.q -pl itests/qtest-iceberg -Pitests

@kasakrisz kasakrisz marked this pull request as draft April 15, 2026 15:47
@kasakrisz kasakrisz force-pushed the HIVE-29496-master-acid-mv-lock branch from c31cc79 to f5ab536 Compare April 16, 2026 06:33
@kasakrisz kasakrisz marked this pull request as ready for review April 16, 2026 08:58
@sonarqubecloud
Copy link
Copy Markdown

create table ice_basetable (a int, b string) stored by iceberg;
insert into ice_basetable values (1, 'alfred'),(2, 'bob'),(2, 'bonnie'),(3, 'calvin'),(3, 'charlie');

create materialized view mv_acid STORED AS ORC TBLPROPERTIES ('transactional'='true') as
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thinking out loud: shouldn't we add a test case when the MV itself stored by iceberg?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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