[ 
https://issues.apache.org/jira/browse/HIVE-24519?focusedWorklogId=530588&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-530588
 ]

ASF GitHub Bot logged work on HIVE-24519:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Jan/21 10:06
            Start Date: 04/Jan/21 10:06
    Worklog Time Spent: 10m 
      Work Description: kasakrisz commented on a change in pull request #1772:
URL: https://github.com/apache/hive/pull/1772#discussion_r551220628



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java
##########
@@ -120,6 +120,8 @@
       new Privilege[]{Privilege.DROP}),
   ALTER_MATERIALIZED_VIEW_REWRITE("ALTER_MATERIALIZED_VIEW_REWRITE", 
HiveParser.TOK_ALTER_MATERIALIZED_VIEW_REWRITE,
       new Privilege[]{Privilege.ALTER_METADATA}, null),
+  ALTER_MATERIALIZED_VIEW_REBUILD("ALTER_MATERIALIZED_VIEW_REBUILD", 
HiveParser.TOK_ALTER_MATERIALIZED_VIEW_REBUILD,

Review comment:
       Without this an exception is thrown at execution time.
   ```
   java.lang.IllegalStateException: Unknown HiveOperation(null) for 
queryId=krisz_20210104002338_38173ed5-af09-4e65-af17-8be1dc49e62e
        at 
org.apache.hadoop.hive.ql.lockmgr.DbTxnManager.verifyState(DbTxnManager.java:315)
        at 
org.apache.hadoop.hive.ql.lockmgr.DbTxnManager.acquireLocks(DbTxnManager.java:389)
   ...
        at org.apache.hadoop.hive.ql.Driver.lockAndRespond(Driver.java:329)
        at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:193)
   ...
   ```
   
   Fixed the inconsistency by setting back the operation type to 
`ALTER_MATERIALIZED_VIEW_REBUILD` after analyzing the query like in the case of 
`CREATE_MATERIALIZED_VIEW`




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 530588)
    Time Spent: 1.5h  (was: 1h 20m)

> Optimize MV: Materialized views should not rebuild when tables are not 
> modified
> -------------------------------------------------------------------------------
>
>                 Key: HIVE-24519
>                 URL: https://issues.apache.org/jira/browse/HIVE-24519
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Materialized views
>            Reporter: Rajesh Balamohan
>            Assignee: Krisztian Kasa
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> e.g
> {noformat}
> create materialized view c_c_address as 
> select c_customer_sk from customer c, customer_address ca where 
> c_current_addr_sk = ca.ca_address_id;
> ALTER MATERIALIZED VIEW c_c_address REBUILD; <-- This shouldn't trigger 
> rebuild, when source tables are not modified
>  {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to