Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-25805

Wrong result when rebuilding MV with count(col) incrementally

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      create table t1(a char(15), b int) stored as orc TBLPROPERTIES ('transactional'='true');
      
      insert into t1(a, b) values ('old', 1);
      
      create materialized view mat1 stored as orc TBLPROPERTIES ('transactional'='true') as
      select t1.a, count(t1.b), count(*) from t1 group by t1.a;
      
      delete from t1 where b = 1;
      
      insert into t1(a,b) values
      ('new', null);
      
      alter materialized view mat1 rebuild;
      
      select * from mat1;
      

      returns

      new            	1	1
      

      but, should be

      new            	0	1
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            kkasa Krisztian Kasa Assign to me
            kkasa Krisztian Kasa
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0h
              0h
              Logged:
              Time Spent - 0.5h
              0.5h

              Slack

                Issue deployment