[ https://issues.apache.org/jira/browse/HIVE-2329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Phabricator updated HIVE-2329: ------------------------------ Attachment: HIVE-2329.D657.1.patch njain requested code review of "HIVE-2329 [jira] Not using map aggregation, fails to execute group-by after cluster-by with same key". Reviewers: JIRA HIVE-2329 hive.map.aggr=false select Q1.key_int1, sum(Q1.key_int1), sum(distinct Q1.key_int1) from (select * from t1 cluster by key_int1) Q1 group by Q1.key_int1 resulted.. FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask from hadoop logs.. Caused by: java.lang.RuntimeException: cannot find field key from [] at org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils.getStandardStructFieldRef(ObjectInspectorUtils.java:321) at org.apache.hadoop.hive.serde2.objectinspector.StandardStructObjectInspector.getStructFieldRef(StandardStructObjectInspector.java:119) at org.apache.hadoop.hive.ql.exec.ExprNodeColumnEvaluator.initialize(ExprNodeColumnEvaluator.java:82) at org.apache.hadoop.hive.ql.exec.GroupByOperator.initializeOp(GroupByOperator.java:198) at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:357) at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:433) ........ I think the problem is caused by ReduceSinkDeDuplication, removing RS which was providing rs.key for GBY operation. If child of child RS is a GBY, we should bypass the optimization. TEST PLAN EMPTY REVISION DETAIL https://reviews.facebook.net/D657 AFFECTED FILES ql/src/test/results/clientpositive/reduce_deduplicate_exclude_gby.q.out ql/src/test/queries/clientpositive/reduce_deduplicate_exclude_gby.q ql/src/java/org/apache/hadoop/hive/ql/optimizer/ReduceSinkDeDuplication.java MANAGE HERALD DIFFERENTIAL RULES https://reviews.facebook.net/herald/view/differential/ WHY DID I GET THIS EMAIL? https://reviews.facebook.net/herald/transcript/1467/ Tip: use the X-Herald-Rules header to filter Herald messages in your client. > Not using map aggregation, fails to execute group-by after cluster-by with > same key > ----------------------------------------------------------------------------------- > > Key: HIVE-2329 > URL: https://issues.apache.org/jira/browse/HIVE-2329 > Project: Hive > Issue Type: Bug > Components: Query Processor > Reporter: Navis > Assignee: Navis > Priority: Minor > Fix For: 0.9.0 > > Attachments: HIVE-2329.1.patch.txt, HIVE-2329.D657.1.patch > > > hive.map.aggr=false > select Q1.key_int1, sum(Q1.key_int1), sum(distinct Q1.key_int1) from (select > * from t1 cluster by key_int1) Q1 group by Q1.key_int1 > resulted.. > FAILED: Execution Error, return code 2 from > org.apache.hadoop.hive.ql.exec.MapRedTask > from hadoop logs.. > Caused by: java.lang.RuntimeException: cannot find field key from [] > at > org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils.getStandardStructFieldRef(ObjectInspectorUtils.java:321) > at > org.apache.hadoop.hive.serde2.objectinspector.StandardStructObjectInspector.getStructFieldRef(StandardStructObjectInspector.java:119) > at > org.apache.hadoop.hive.ql.exec.ExprNodeColumnEvaluator.initialize(ExprNodeColumnEvaluator.java:82) > at > org.apache.hadoop.hive.ql.exec.GroupByOperator.initializeOp(GroupByOperator.java:198) > at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:357) > at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:433) > ........ > I think the problem is caused by ReduceSinkDeDuplication, removing RS which > was providing rs.key for GBY operation. If child of child RS is a GBY, we > should bypass the optimization. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira