> MV datamap - When the MV datamap is created for the operators: sum(col1)+sum(col2) then when we execute a query of sum(col1+col2) it is not accessing the data from the MV.
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CARBONDATA-2526
> URL:
https://issues.apache.org/jira/browse/CARBONDATA-2526> Project: CarbonData
> Issue Type: Bug
> Components: data-query
> Environment: 3 Node Opensource ANT cluster.
> Reporter: Prasanna Ravichandran
> Assignee: Ravindra Pesala
> Priority: Minor
> Labels: CarbonData, MV, Materialistic_Views
> Attachments: Arithmetic.docx, Screenshot_MV.png, data.csv
>
>
> When the MV datamap is created for the operators like: sum(col1)+sum(col2) then when we execute a query like sum(col1+col2), then it is not accessing the data from the created MV.
> Test queries:
> CREATE TABLE originTable (empno int, empname String, designation String, doj Timestamp,
> workgroupcategory int, workgroupcategoryname String, deptno int, deptname String,
> projectcode int, projectjoindate Timestamp, projectenddate Timestamp,attendance int,
> utilization int,salary int)
> STORED BY 'org.apache.carbondata.format';
> LOAD DATA local inpath 'hdfs://hacluster/user/prasanna/data.csv' INTO TABLE originTable OPTIONS('DELIMITER'= ',', 'QUOTECHAR'= '"','timestampformat'='dd-MM-yyyy');
> create datamap arithmetic_op using 'mv' as select empno,sum(salary)+sum(utilization) as total , sum(salary)/sum(utilization) as updownratio from originTable where empno>10 group by empno;
> rebuild datamap arithmetic_op;
> explain select empno,sum(salary)+sum(utilization) as total , sum(salary)/sum(utilization) as updownratio from originTable where empno>10 group by empno;
> explain select empno,sum(salary+utilization) as total from originTable where empno>10 group by empno;
> As sum(col1)+sum(col2) = sum(col1+col2) are equal, it should point to the same datamap.