hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xuefu Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-11712) Duplicate groupby keys cause ClassCastException
Date Tue, 01 Sep 2015 23:12:46 GMT

    [ https://issues.apache.org/jira/browse/HIVE-11712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14726400#comment-14726400
] 

Xuefu Zhang commented on HIVE-11712:
------------------------------------

Thanks for working on this. In the given query, I'm wondering what are the duplicated groupby
keys?

> Duplicate groupby keys cause ClassCastException
> -----------------------------------------------
>
>                 Key: HIVE-11712
>                 URL: https://issues.apache.org/jira/browse/HIVE-11712
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Jimmy Xiang
>            Assignee: Jimmy Xiang
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: HIVE-11712.1.patch
>
>
> With duplicate groupby keys, we could use wrong object inspectors for some groupby expressions,
and lead to ClassCastException, for example, 
> {noformat}
> explain
> SELECT distinct s1.customer_name as x, s1.customer_name as y
> FROM default.testv1_staples s1 join default.src s2 on s1.customer_name = s2.key
> HAVING (
> (SUM(s1.customer_balance) <= 4074689.000000041)
> AND (AVG(s1.discount) <= 822)
> AND (COUNT(s2.value) > 4)
> {noformat}
> will lead to
> {noformat}
> Caused by: java.lang.ClassCastException: org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableShortObjectInspector
cannot be cast to org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector
> 	at org.apache.hadoop.hive.ql.udf.generic.GenericUDAFAverage$AbstractGenericUDAFAverageEvaluator.init(GenericUDAFAverage.java:374)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getGenericUDAFInfo(SemanticAnalyzer.java:3887)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genGroupByPlanGroupByOperator1(SemanticAnalyzer.java:4354)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genGroupByPlanMapAggrNoSkew(SemanticAnalyzer.java:5644)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(SemanticAnalyzer.java:8977)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:9849)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:9742)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genOPTree(SemanticAnalyzer.java:10178)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:10189)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:10106)
> 	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:222)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message