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

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

                Author: ASF GitHub Bot
            Created on: 07/Jul/22 04:17
            Start Date: 07/Jul/22 04:17
    Worklog Time Spent: 10m 
      Work Description: kasakrisz opened a new pull request, #3420:
URL: https://github.com/apache/hive/pull/3420

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: 
https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: 
https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., 
'[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a 
faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   Restore MV status query to check the txn log instead of stats.
   
   ### Why are the changes needed?
   Compaction deletes the delete delta files so even if stats indicates that 
there were updates on one of the mv source tables the delta is no longer 
reproducible.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   ```
   mvn test -Dtest=TestMaterializedViewRebuild -pl itests/hive-unit -Pitests
   mvn test -Dtest=TestTxnHandler -pl ql
   ```
   




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

            Worklog Id:     (was: 788465)
    Remaining Estimate: 0h
            Time Spent: 10m

> Invalid materialized view after rebuild if source table was compacted
> ---------------------------------------------------------------------
>
>                 Key: HIVE-26375
>                 URL: https://issues.apache.org/jira/browse/HIVE-26375
>             Project: Hive
>          Issue Type: Bug
>          Components: Materialized views, Transactions
>            Reporter: Krisztian Kasa
>            Assignee: Krisztian Kasa
>            Priority: Major
>             Fix For: 4.0.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> After HIVE-25656 MV state depends on the number of rows deleted/updated in 
> the source tables of the view. However if one of the source tables are major 
> compacted the delete delta files are no longer available and reproducing the 
> rows should be deleted from the MV is no longer possible.
> {code}
> create table t1(a int, b varchar(128), c float) stored as orc TBLPROPERTIES 
> ('transactional'='true');
> insert into t1(a,b, c) values (1, 'one', 1.1), (2, 'two', 2.2), (NULL, NULL, 
> NULL);
> create materialized view mv1 stored as orc TBLPROPERTIES 
> ('transactional'='true') as select a,b,c from t1 where a > 0 or a is null;
> update t1 set b = 'Changed' where a = 1;
> alter table t1 compact 'major';
> alter materialized view t1 rebuild;
> select * from mv1;
> {code}
> Select should result 
> {code}
>       "1\tChanged\t1.1",
>       "2\ttwo\t2.2",
>       "NULL\tNULL\tNULL"
> {code}
> but was
> {code}
>       "1\tone\t1.1",      
>       "2\ttwo\t2.2",
>       "NULL\tNULL\tNULL",
>       "1\tChanged\t1.1"
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to