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

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

                Author: ASF GitHub Bot
            Created on: 17/May/21 06:53
            Start Date: 17/May/21 06:53
    Worklog Time Spent: 10m 
      Work Description: kasakrisz opened a new pull request #2280:
URL: https://github.com/apache/hive/pull/2280


   <!--
   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?
   Call `isSourceTablesCompacted` instead of `isSetSourceTablesCompacted` when 
validating materialized views. Latter method only check whether the property is 
null or not.
   
   ### Why are the changes needed?
   `isSetSourceTablesCompacted` method check whether the property value should 
be treated as null values or not and we need the non-null value here.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   ```
   mvn test -Dtest.output.overwrite -DskipSparkTests 
-Dtest=TestMiniLlapLocalCliDriver -Dqfile=materialized_view_create_rewrite_4.q 
-pl itests/qtest -Pitests
   mvn test -Dtest=TestMaterializedViewRebuild -pl itests/hive-unit -Pitests
   ```


-- 
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: 597478)
    Time Spent: 2.5h  (was: 2h 20m)

> Materialized View incremental rebuild produces wrong result set after 
> compaction
> --------------------------------------------------------------------------------
>
>                 Key: HIVE-24840
>                 URL: https://issues.apache.org/jira/browse/HIVE-24840
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Krisztian Kasa
>            Assignee: Krisztian Kasa
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> {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 mat1 stored as orc TBLPROPERTIES 
> ('transactional'='true') as 
>             select a,b,c from t1 where a > 0 or a is null;
> delete from t1 where a = 1;
> alter table t1 compact 'major';
> -- Wait until compaction finished.
> alter materialized view mat1 rebuild;
> {code}
> Expected result of query
> {code}
> select * from mat1;
> {code}
> {code}
> 2 two 2
> NULL NULL NULL
> {code}
> but if incremental rebuild is enabled the result is
> {code}
> 1 one 1
> 2 two 2
> NULL NULL NULL
> {code}
> Cause: Incremental rebuild queries whether the source tables of a 
> materialized view has delete or update transaction since the last rebuild 
> from metastore from COMPLETED_TXN_COMPONENTS table. However when a major 
> compaction is performed on the source tables the records related to these 
> tables are deleted from COMPLETED_TXN_COMPONENTS.



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

Reply via email to