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

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

                Author: ASF GitHub Bot
            Created on: 14/Dec/20 10:44
            Start Date: 14/Dec/20 10:44
    Worklog Time Spent: 10m 
      Work Description: kasakrisz opened a new pull request #1772:
URL: https://github.com/apache/hive/pull/1772


   ### What changes were proposed in this pull request?
   1. If the materialized view after compilation in 
`AlterMaterializedViewRebuildAnalyzer` is up to date clear all root task in 
`SemanticAnalyzer` to cancel query execution and print a message to the console.
   2. `validTxnsList`, `currentTxnWriteIds` and `timeWindow` was calculated 
before every call of `isOutdatedMaterializedView`. These are moved to 
`isOutdatedMaterializedView` method body. Since this requires `Hive` instance  
`isOutdatedMaterializedView` is moved from `HiveMaterializedViewUtils` to 
`Hive.java` as an instance method.
   3. Call `Hive.isOutdatedMaterializedView` from 
`AlterMaterializedViewRebuildAnalyzer` and `DescTableOperation`
   
   ### Why are the changes needed?
   Optimize MV rewrite.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. When executing `alter materialized view <materialized view name> 
rebuild` commands and MV is up to date a message like this is written into 
console:
   ```
   Materialized view default.mat1 is up to date. Cancelling rebuild.
   ```
   
   ### How was this patch tested?
   ```
   mvn test -Dtest.output.overwrite -DskipSparkTests 
-Dtest=TestMiniLlapLocalCliDriver -Dqfile=mv_rebuild.q -pl itests/qtest -Pitests
   mvnql 
materialized_view_rewrite_1.q,materialized_view_rewrite_2.q,materialized_view_rewrite_3.q,materialized_view_rewrite_4.q,materialized_view_rewrite_5.q,materialized_view_rewrite_6.q,materialized_view_rewrite_7.q,materialized_view_rewrite_8.q,materialized_view_rewrite_9.q,materialized_view_rewrite_10
   ```


----------------------------------------------------------------
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: 523799)
    Remaining Estimate: 0h
            Time Spent: 10m

> 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
>          Time Spent: 10m
>  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