Uploaded image for project: 'Tajo (Retired)'
  1. Tajo (Retired)
  2. TAJO-226

Can't use group by column alias

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.2-incubating
    • Planner/Optimizer
    • None

    Description

      I ran the bellow query which uses column alias and group by.

      select b.n_name as nation, count(*) as cnt
        from customer_100 a, nation_100 b 
       where a.c_nationkey = b.n_nationkey 
       group by b.n_name
       order by cnt desc
       limit 7
      

      This query doesn't end. I found next error message in tajo worker's log.

      2013-10-02 21:41:21,804 INFO  planner.PhysicalPlannerImpl (PhysicalPlannerImpl.java:createBestAggregationPlan(606)) - The planner chooses [Hash Aggregation]
      2013-10-02 21:41:21,804 INFO  planner.PhysicalPlannerImpl (PhysicalPlannerImpl.java:createInMemoryHashAggregation(558)) - The planner chooses [Hash Aggregation]
      2013-10-02 21:41:21,808 ERROR worker.Task (Task.java:run(389)) - java.lang.ArrayIndexOutOfBoundsException: 1
              at org.apache.tajo.engine.planner.physical.AggregationExec.<init>(AggregationExec.java:86)
              at org.apache.tajo.engine.planner.physical.HashAggregateExec.<init>(HashAggregateExec.java:48)
              at org.apache.tajo.engine.planner.PhysicalPlannerImpl.createInMemoryHashAggregation(PhysicalPlannerImpl.java:559)
              at org.apache.tajo.engine.planner.PhysicalPlannerImpl.createBestAggregationPlan(PhysicalPlannerImpl.java:607)
              at org.apache.tajo.engine.planner.PhysicalPlannerImpl.createGroupByPlan(PhysicalPlannerImpl.java:553)
              at org.apache.tajo.engine.planner.PhysicalPlannerImpl.createPlanRecursive(PhysicalPlannerImpl.java:148)
              at org.apache.tajo.engine.planner.PhysicalPlannerImpl.createPlanRecursive(PhysicalPlannerImpl.java:152)
              at org.apache.tajo.engine.planner.PhysicalPlannerImpl.createPlanRecursive(PhysicalPlannerImpl.java:169)
              at org.apache.tajo.engine.planner.PhysicalPlannerImpl.createPlan(PhysicalPlannerImpl.java:74)
              at org.apache.tajo.worker.TajoQueryEngine.createPlan(TajoQueryEngine.java:47)
              at org.apache.tajo.worker.Task.run(Task.java:378)
              at org.apache.tajo.worker.TaskRunner$2.run(TaskRunner.java:364)
              at java.lang.Thread.run(Thread.java:662)
      
      2013-10-02 21:41:21,808 INFO  worker.Task (Task.java:run(434)) - Task Counter - total:11, succeeded: 10, failed: 1
      2013-10-02 21:41:21,808 INFO  worker.TaskRunner (TaskRunner.java:run(307)) - Request GetTask: eb_1380717656859_0001_000004,container_1380717656859_0001_01_000040
      2013-10-02 21:41:21,809 ERROR querymaster.QueryUnitAttempt (QueryUnitAttempt.java:transition(312)) - FROM gruter104.gruter.com >> java.lang.ArrayIndexOutOfBoundsException: 1
              at org.apache.tajo.engine.planner.physical.AggregationExec.<init>(AggregationExec.java:86)
              at org.apache.tajo.engine.planner.physical.HashAggregateExec.<init>(HashAggregateExec.java:48)
              at org.apache.tajo.engine.planner.PhysicalPlannerImpl.createInMemoryHashAggregation(PhysicalPlannerImpl.java:559)
              at org.apache.tajo.engine.planner.PhysicalPlannerImpl.createBestAggregationPlan(PhysicalPlannerImpl.java:607)
              at org.apache.tajo.engine.planner.PhysicalPlannerImpl.createGroupByPlan(PhysicalPlannerImpl.java:553)
              at org.apache.tajo.engine.planner.PhysicalPlannerImpl.createPlanRecursive(PhysicalPlannerImpl.java:148)
              at org.apache.tajo.engine.planner.PhysicalPlannerImpl.createPlanRecursive(PhysicalPlannerImpl.java:152)
              at org.apache.tajo.engine.planner.PhysicalPlannerImpl.createPlanRecursive(PhysicalPlannerImpl.java:169)
              at org.apache.tajo.engine.planner.PhysicalPlannerImpl.createPlan(PhysicalPlannerImpl.java:74)
              at org.apache.tajo.worker.TajoQueryEngine.createPlan(TajoQueryEngine.java:47)
              at org.apache.tajo.worker.Task.run(Task.java:378)
              at org.apache.tajo.worker.TaskRunner$2.run(TaskRunner.java:364)
              at java.lang.Thread.run(Thread.java:662)
      
      2013-10-02 21:41:21,809 INFO  event.TaskScheduleEvent (TaskSchedulerImpl.java:handle(232)) - TaskRequest: container_1380717656859_0001_01_000040,eb_1380717656859_0001_000004
      2013-10-02 21:41:21,809 INFO  querymaster.QueryUnit (QueryUnit.java:transition(432)) - =============================================================
      2013-10-02 21:41:21,810 INFO  querymaster.QueryUnit (QueryUnit.java:transition(433)) - >>> Task Failed: ta_1380717656859_0001_000004_000000_00 <<<
      2013-10-02 21:41:21,810 INFO  querymaster.QueryUnit (QueryUnit.java:transition(434)) - ============================================================= 
      

      Attachments

        1. TAJO-226.patch
          19 kB
          Hyunsik Choi
        2. TAJO-226_2.patch
          19 kB
          Hyunsik Choi

        Issue Links

          Activity

            People

              hyunsik Hyunsik Choi
              babokim kim hyoung jun
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: