You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by "Jacky Li (JIRA)" <ji...@apache.org> on 2018/07/24 11:29:01 UTC

[jira] [Resolved] (CARBONDATA-2531) [MV] MV not hit when alias is in use

     [ https://issues.apache.org/jira/browse/CARBONDATA-2531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacky Li resolved CARBONDATA-2531.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.4.1
                   1.5.0

> [MV] MV not hit when alias is in use
> ------------------------------------
>
>                 Key: CARBONDATA-2531
>                 URL: https://issues.apache.org/jira/browse/CARBONDATA-2531
>             Project: CarbonData
>          Issue Type: Bug
>            Reporter: Babulal
>            Assignee: xubo245
>            Priority: Major
>             Fix For: 1.5.0, 1.4.1
>
>          Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> #testcase class  
> MVCreateTestCase 
>  
> CREATE TABLE fact5 (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 '/tmp/babu/data_big.csv' INTO TABLE fact5 OPTIONS('DELIMITER'= ',', 'QUOTECHAR'= '"','timestampformat'='dd-MM-yyyy');
> create datamap datamap53 using 'mv' as select deptname, sum(salary) from fact4 group by deptname
>  
> 0: jdbc:hive2://10.18.222.231:23040> explain select deptname, sum(salary) from fact4 as tt group by deptname;
> +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--+
> | plan |
> +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--+
> | == Physical Plan ==
> *BatchedScan CarbonDatasourceHadoopRelation [ Database name :default, Table name :{color:#14892c}datamap53_table{color}, Schema :Some(StructType(StructField(fact4_deptname,StringType,true), StructField(sum_salary,LongType,true))) ] default.datamap53_table[fact4_deptname#1539,sum_salary#5961L] |
> +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+–+
>  
>  
> Now use alias for column name 
> 0: jdbc:hive2://10.18.222.231:23040> explain select deptname as babu, sum(salary) from fact4 as tt group by deptname;
> | plan |
> +------------------------------------------------------------------------------------------------------------------+--+
> |
> | == Physical Plan ==
> *HashAggregate(keys=[deptname#1539], functions=[sum(cast(salary#1545 as bigint))])
> +- Exchange hashpartitioning(deptname#1539, 200)
>  +- *HashAggregate(keys=[deptname#1539], functions=[partial_sum(cast(salary#1545 as bigint))])
>  +- *BatchedScan CarbonDatasourceHadoopRelation [ Database name :default, Table name {color:#FF0000}:*fact4*,{color} Schema :Some(StructType(StructField(empname,StringType,true), StructField(designation,StringType,true), StructField(doj,TimestampType,true), StructField(workgroupcategory,IntegerType,true), StructField(workgroupcategoryname,StringType,true), StructField(deptno,IntegerType,true), StructField(deptname,StringType,true), StructField(projectcode,IntegerType,true), StructField(projectjoindate,TimestampType,true), StructField(projectenddate,TimestampType,true), StructField(attendance,IntegerType,true), StructField(utilization,IntegerType,true), StructField(salary,IntegerType,true))) ] default.fact4[deptname#1539,salary#1545] |
> +-----------------------------------------------------------------------------------------------------------------
>  
> Alias should be ignored data data should be fetched from MV table datamap53_table.
>  



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