Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-410

A query with a combination of general and distinct aggregation functions fails

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8.0
    • Component/s: Planner/Optimizer
    • Labels:
      None

      Description

      select 
          l_orderkey, 
          count(*) as cnt, 
          count(distinct l_linenumber) as unique_key 
      from 
          lineitem
      group by 
          l_orderkey;
      

      The above query causes the following error:

      /tajo-localdir/q_1386667006044_0002/output
      2013-12-10 18:33:48,792 ERROR querymaster.QueryUnitAttempt (QueryUnitAttempt.java:transition(293)) - FROM  >> java.lang.Arrayy
      IndexOutOfBoundsException: 0
              at org.apache.tajo.storage.VTuple.get(VTuple.java:97)
              at org.apache.tajo.engine.function.builtin.CountRows.merge(CountRows.java:54)
              at org.apache.tajo.engine.eval.AggregationFunctionCallEval.eval(AggregationFunctionCallEval.java:65)
              at org.apache.tajo.engine.planner.physical.SortAggregateExec.next(SortAggregateExec.java:57)
              at org.apache.tajo.engine.planner.physical.StoreTableExec.next(StoreTableExec.java:84)
              at org.apache.tajo.worker.Task.run(Task.java:358)
              at org.apache.tajo.worker.TaskRunner$1.run(TaskRunner.java:376)
              at java.lang.Thread.run(Thread.java:662)
      
      2013-12-10 18:33:48,792 INFO  event.DefaultTaskSchedulerEvent (DefaultTaskScheduler.java:handle(233)) - TaskRequest: container_138666700
      06044_0002_01_000188,eb_1386667006044_0002_000002
      2013-12-10 18:33:48,792 INFO  querymaster.QueryUnit (QueryUnit.java:transition(433)) - 
      
      1. TAJO-410.patch
        3 kB
        Hyunsik Choi

        Activity

        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Tajo-trunk-postcommit #612 (See https://builds.apache.org/job/Tajo-trunk-postcommit/612/)
        TAJO-410: A query with a combination of general and distinct aggregation functions fails. (hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=df56fca7c0d47188497444052eeea9b0abc9cbf6)

        • tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java
        • CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Tajo-trunk-postcommit #612 (See https://builds.apache.org/job/Tajo-trunk-postcommit/612/ ) TAJO-410 : A query with a combination of general and distinct aggregation functions fails. (hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=df56fca7c0d47188497444052eeea9b0abc9cbf6 ) tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java CHANGES.txt
        Hide
        hyunsik Hyunsik Choi added a comment -

        committed this bug fix to master. Thanks for the quick review.

        Show
        hyunsik Hyunsik Choi added a comment - committed this bug fix to master. Thanks for the quick review.
        Hide
        blrunner Jaehwa Jung added a comment -

        +1.

        It looks good for me.
        I've verified 'mvn clean install'.

        Show
        blrunner Jaehwa Jung added a comment - +1. It looks good for me. I've verified 'mvn clean install'.
        Hide
        hyunsik Hyunsik Choi added a comment -

        This patch contains an unit test to reproduce the problematic case and the bug fix. I verified 'mvn clean install'.

        Show
        hyunsik Hyunsik Choi added a comment - This patch contains an unit test to reproduce the problematic case and the bug fix. I verified 'mvn clean install'.

          People

          • Assignee:
            hyunsik Hyunsik Choi
            Reporter:
            hyunsik Hyunsik Choi
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development