Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-6397

IllegalStateException in planning of aggregation with float and decimal literal child expressions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Impala 2.9.0, Impala 2.10.0, Impala 2.11.0
    • Fix Version/s: Impala 3.0
    • Component/s: Frontend
    • Labels:
    • Epic Color:
      ghx-label-8

      Description

      Reproduction:

      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)
      

      FE Stack:

      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)
      

      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:

      select sum(float_col + 1.2) from functional.alltypes;
      

      Also note that this bug only happens in combination with a decimal literal. The following query also works fine:

      create table t (f float, d decimal (2,1));
      select sum(float_col + d) from (select f, d from t) v;
      // works fine
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alex.behm Alexander Behm
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: