carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Babulal (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CARBONDATA-2030) avg with Aggregate table for double data type is failed.
Date Mon, 15 Jan 2018 16:39:00 GMT
Babulal created CARBONDATA-2030:
-----------------------------------

             Summary: avg with Aggregate table for double data type is failed. 
                 Key: CARBONDATA-2030
                 URL: https://issues.apache.org/jira/browse/CARBONDATA-2030
             Project: CarbonData
          Issue Type: Bug
            Reporter: Babulal


spark.sql("drop table if exists y ")
spark.sql("create table y(year int,month int,name string,salary double) stored by 'carbondata'
tblproperties('sort_scope'='Global_sort','table_blocksize'='23','sort_columns'='month,year,name')")

spark.sql("insert into y select 10,11,'babu',12.89")

spark.sql("insert into y select 10,11,'babu',12.89")

spark.sql("create datamap y1_sum1 on table y using 'preaggregate' as select name,avg(salary)
from y group by name")

spark.sql("select name,avg(salary) from y group by name").show(false)

 

 

Exception in thread "main" org.apache.spark.sql.AnalysisException: cannot resolve '(sum(y_y1_sum1.`y_salary_sum`)
/ sum(y_y1_sum1.`y_salary_count`))' due to data type mismatch: differing types in '(sum(y_y1_sum1.`y_salary_sum`)
/ sum(y_y1_sum1.`y_salary_count`))' (double and bigint).;;
'Aggregate [y_name#25], [y_name#25 AS name#41, (sum(y_salary_sum#26) / sum(y_salary_count#27L))
AS avg(salary)#46]

+- Relation[y_name#25,y_salary_sum#26,y_salary_count#27L] CarbonDatasourceHadoopRelation [
Database name :default, Table name :y_y1_sum1, Schema :Some(StructType(StructField(y_name,StringType,true),
StructField(y_salary_sum,DoubleType,true), StructField(y_salary_count,LongType,true))) ]

 



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

Mime
View raw message