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

SeqScanExec.rewriteColumnPartitionedTableSchema has a bug

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 0.8.0
    • Fix Version/s: None
    • Component/s: distributed query plan
    • Labels:
      None

      Description

      SeqScanExec.rewriteColumnPartitionedTableSchema only rewrites inputSchema, remove the partition columns from input schema. but doesn't change plan.getTargets().

      If we have a table with 3 columns include 1 partition column, my query select all the 3 of them. Then the input schema will be rewritted into 2 columns, and plan.getTargets still have 3 columns.

      After that, evalContexts which based on plan.getTargets() will be supposed to evaluate 3 columns.

          this.projector = new Projector(inSchema, outSchema, plan.getTargets());
          this.evalContexts = projector.renew();
      

      This line will cause NullPointerException due to evalContexts evaluate 3 columns

      projector.eval(evalContexts, tuple);
      

      Here is an example

      2014-01-14 18:43:52,687 ERROR worker.Task (Task.java:run(378)) - java.lang.NullPointerException
      	at org.apache.tajo.catalog.Schema.getColumnId(Schema.java:142)
      	at org.apache.tajo.engine.eval.FieldEval.eval(FieldEval.java:51)
      	at org.apache.tajo.engine.planner.Projector.eval(Projector.java:87)
      	at org.apache.tajo.engine.planner.physical.SeqScanExec.next(SeqScanExec.java:174)
      	at org.apache.tajo.engine.planner.physical.HashAggregateExec.compute(HashAggregateExec.java:57)
      	at org.apache.tajo.engine.planner.physical.HashAggregateExec.next(HashAggregateExec.java:83)
      	at org.apache.tajo.engine.planner.physical.HashShuffleFileWriteExec.next(HashShuffleFileWriteExec.java:117)
      	at org.apache.tajo.worker.Task.run(Task.java:370)
      	at org.apache.tajo.worker.TaskRunner$1.run(TaskRunner.java:392)
      	at java.lang.Thread.run(Thread.java:724)
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                coderplay Min Zhou
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: