[ https://issues.apache.org/jira/browse/HIVE-20996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16707666#comment-16707666 ]
Gopal V commented on HIVE-20996: -------------------------------- [~jcamachorodriguez]: it is possible the MV registry is not picking up the PK info, so the MV plan might have a GBY and the exec plan does not. > MV rewriting not triggering > --------------------------- > > Key: HIVE-20996 > URL: https://issues.apache.org/jira/browse/HIVE-20996 > Project: Hive > Issue Type: Improvement > Reporter: Vineet Garg > Assignee: Jesus Camacho Rodriguez > Priority: Major > > {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)