Vineet Garg created HIVE-20996:
----------------------------------

             Summary: MV rewriting not triggering
                 Key: HIVE-20996
                 URL: https://issues.apache.org/jira/browse/HIVE-20996
             Project: Hive
          Issue Type: Improvement
            Reporter: Vineet Garg


{code:sql}
set hive.support.concurrency=true;
set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
set hive.strict.checks.cartesian.product=false;
set hive.stats.fetch.column.stats=true;
set hive.materializedview.rewriting=true;

create table emps_n3 (
  empid int,
  deptno int,
  name varchar(256),
  salary float,
  commission int)
stored as orc TBLPROPERTIES ('transactional'='true');

insert into emps_n3 values (100, 10, 'Bill', 10000, 1000), (200, 20, 'Eric', 
8000, 500),
  (150, 10, 'Sebastian', 7000, null), (110, 10, 'Theodore', 10000, 250), (120, 
10, 'Bill', 10000, 250);

analyze table emps_n3 compute statistics for columns;

alter table emps_n3 add constraint pk1 primary key (empid) disable novalidate 
rely;

create materialized view mv1_n2 as
select empid, deptno from emps_n3 group by empid, deptno;


explain
select empid, deptno from emps_n3 group by empid, deptno;
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to