You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Dayakar M (Jira)" <ji...@apache.org> on 2026/03/10 07:21:00 UTC
[jira] [Commented] (HIVE-29496) Materialized view rebuild fails with "SemanticException: Another process is rebuilding the materialized view mydb.ice_mv1" OR "SemanticException: Exception acquiring lock for rebuilding the materialized view" when source is an iceberg table
[ https://issues.apache.org/jira/browse/HIVE-29496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18064355#comment-18064355 ]
Dayakar M commented on HIVE-29496:
----------------------------------
It looks this is duplicate to the issue [HIVE-29436|https://issues.apache.org/jira/browse/HIVE-29436]
cc: [~kkasa]
> Materialized view rebuild fails with "SemanticException: Another process is rebuilding the materialized view mydb.ice_mv1" OR "SemanticException: Exception acquiring lock for rebuilding the materialized view" when source is an iceberg table
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HIVE-29496
> URL: https://issues.apache.org/jira/browse/HIVE-29496
> Project: Hive
> Issue Type: Bug
> Components: Hive
> Reporter: Venugopal Reddy K
> Priority: Major
>
> *[Description]*
> when source is an iceberg table, materialized view rebuild succeeds for the first time. But subsequent materialized view rebuild fail with one of these exceptions.
> "SemanticException org.apache.hadoop.hive.ql.parse.SemanticException: Another process is rebuilding the materialized view mydb.ice_mv1;" +when rebuild is tried with same materialized view as first succeeded one.+
> *OR*
> "SemanticException org.apache.hadoop.hive.ql.parse.SemanticException: Exception acquiring lock for rebuilding the materialized view;" +when rebuild is tried with different materialized view.+
> Happens because lock is acquired with txn id as 0 and not released after rebuild. And MRL_TXN_ID is PRIMARY KEY for MATERIALIZATION_REBUILD_LOCKS table.
> ||MATERIALIZATION_REBUILD_LOCKS||
> ||MRL_TXN_ID||MRL_DB_NAME||MRL_TBL_NAME||MRL_LAST_HEARTBEAT||
> |{color:#ff0000}0{color}|mydb|ice_mv1|1,773,117,466,400|
>
> *[Steps to reproduce]*
> # Create an iceberg table, insert some data to it.
> # Create a materialized view(either in Hive ACID or Iceberg format) with source as above created iceberg table.
> # Insert some data into iceberg table again so that mv becomes outdated for rewriting.
> # Alter materialized view rebuild so that it can be used in rewriting.
> # Repeat step-3 and step-4 again. This time materialized view rebuild throws *Error: Error while compiling statement: FAILED: SemanticException org.apache.hadoop.hive.ql.parse.SemanticException: Another process is rebuilding the materialized view mydb.ice_mv1;*
> # Here after, none of the other materialized views(created with any iceberg source table) rebuild works. All of them fail with below exception. Can verify with below steps.
> ## Try creating another iceberg table, insert some data and another materialized view.
> ## Insert some more data to the iceberg table and rebuild the mv created on step-6. Materialized view Rebuild throws - {*}Error: Error while compiling statement: FAILED: SemanticException org.apache.hadoop.hive.ql.parse.SemanticException: Exception acquiring lock for rebuilding the materialized view;{*}{*}{*}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)