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

Error in analytic sort with same expr in 'partition by' and 'order by'

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Impala 2.12.0
    • Fix Version/s: Impala 3.0
    • Component/s: Frontend
    • Labels:
      None
    • Epic Color:
      ghx-label-4

      Description

      Repro:

      drop table if exists default.tt;
      CREATE TABLE default.tt (instruction_date timestamp);
      SELECT sum(1) OVER( partition by to_date(instruction_date) ORDER BY to_date(instruction_date) rows UNBOUNDED PRECEDING) FROM default.tt;
      

      Stack:

      I0205 14:16:03.763309  4889 jni-util.cc:230] java.lang.IllegalStateException 
              at com.google.common.base.Preconditions.checkState(Preconditions.java:129) 
              at org.apache.impala.analysis.ExprSubstitutionMap.verify(ExprSubstitutionMap.java:162) 
              at org.apache.impala.analysis.ExprSubstitutionMap.combine(ExprSubstitutionMap.java:128) 
              at org.apache.impala.planner.AnalyticPlanner.createSortInfo(AnalyticPlanner.java:304) 
              at org.apache.impala.planner.AnalyticPlanner.createSortGroupPlan(AnalyticPlanner.java:348) 
              at org.apache.impala.planner.AnalyticPlanner.createSingleNodePlan(AnalyticPlanner.java:120) 
              at org.apache.impala.planner.SingleNodePlanner.createQueryPlan(SingleNodePlanner.java:269) 
              at org.apache.impala.planner.SingleNodePlanner.createSingleNodePlan(SingleNodePlanner.java:150) 
              at org.apache.impala.planner.Planner.createPlan(Planner.java:98) 
              at org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1030) 
              at org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1127) 
              at org.apache.impala.service.JniFrontend.createExecRequest(JniFrontend.java:156) 
      

      The problem is caused by using the same expr in both the 'partition by' and 'order by' clauses of the analytic function.

        Attachments

          Activity

            People

            • Assignee:
              twmarshall Thomas Tauber-Marshall
              Reporter:
              twmarshall Thomas Tauber-Marshall
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: