Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
create table t1 (a int, b decimal(3,2)) stored as orc TBLPROPERTIES ('transactional'='true'); create materialized view mv1 as select a, sum(b), count(b) from t1 group by a; explain cbo select a, avg(b) from t1 group by a;
MV is not used
CBO PLAN:
HiveProject(a=[$0], _o__c1=[CAST(/($1, $2)):DECIMAL(7, 6)])
HiveAggregate(group=[{0}], agg#0=[sum($1)], agg#1=[count($1)])
HiveTableScan(table=[[default, t1]], table:alias=[t1])
If avg input is not decimal but for example int the query plan is rewritten to use the MV
Attachments
Issue Links
- links to