Min Zhou created TAJO-505:
-----------------------------
Summary: SeqScanExec.rewriteColumnPartitionedTableSchema has a bug
Key: TAJO-505
URL: https://issues.apache.org/jira/browse/TAJO-505
Project: Tajo
Issue Type: Bug
Components: distributed query plan
Affects Versions: 0.8-incubating
Reporter: Min Zhou
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.
{noformat}
this.projector = new Projector(inSchema, outSchema, plan.getTargets());
this.evalContexts = projector.renew();
{noformat}
This line will cause NullPointerException due to evalContexts evaluate 3 columns
{noformat}
projector.eval(evalContexts, tuple);
{noformat}
Here is an example
{noformat}
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)
{noformat}
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)