Alexander Behm created IMPALA-6397: -------------------------------------- Summary: IllegalStateException in planning of aggregation with float and decimal literal child expressions Key: IMPALA-6397 URL: https://issues.apache.org/jira/browse/IMPALA-6397 Project: IMPALA Issue Type: Bug Components: Frontend Affects Versions: Impala 2.11.0, Impala 2.10.0, Impala 2.9.0 Reporter: Alexander Behm
Reproduction: {code} select sum(float_col + d) from (select float_col, 1.2 d from functional.alltypes) v; ERROR: IllegalStateException: Agg expr sum(float_col + 1.2) returns type DOUBLE but its output tuple slot has type DECIMAL(38,9) {code} FE Stack: {code} I0113 14:44:36.300395 9285 jni-util.cc:211] java.lang.IllegalStateException: Agg expr sum(f + 1.2) returns type DOUBLE but its output tuple slot has type DECIMAL(38,9) at com.google.common.base.Preconditions.checkState(Preconditions.java:145) at org.apache.impala.analysis.AggregateInfo.checkConsistency(AggregateInfo.java:702) at org.apache.impala.planner.AggregationNode.init(AggregationNode.java:165) at org.apache.impala.planner.SingleNodePlanner.createAggregationPlan(SingleNodePlanner.java:895) at org.apache.impala.planner.SingleNodePlanner.createSelectPlan(SingleNodePlanner.java:621) at org.apache.impala.planner.SingleNodePlanner.createQueryPlan(SingleNodePlanner.java:257) at org.apache.impala.planner.SingleNodePlanner.createSingleNodePlan(SingleNodePlanner.java:147) at org.apache.impala.planner.Planner.createPlan(Planner.java:101) at org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1044) at org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1147) at org.apache.impala.service.JniFrontend.createExecRequest(JniFrontend.java:156) {code} This bug does not happen with DECIMAL_V2=true. It is specific to the implicit casting behavior of DECIMAL_V1 with decimal literals. Note that the following equivalent query without the inline view works fine: {code} select sum(float_col + 1.2) from functional.alltypes; {code} Also note that this bug only happens in combination with a decimal literal. The following query also works fine: {code} create table t (f float, d decimal (2,1)); select sum(float_col + d) from (select f, d from t) v; // works fine {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)