[ 
https://issues.apache.org/jira/browse/TAJO-505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13872873#comment-13872873
 ] 

Hyunsik Choi commented on TAJO-505:
-----------------------------------

Two input column, three targets, three output columns are collect If we have a 
table with 3 columns include 1 partition column. Target means an aliased 
expression, each of which can be field reference or constant values. So, the 
third target corresponding to 1 partition column must be replaced with constant 
value obtained from a table file patch in SeqScanExec. I'm expecting that this 
part has some problem. This problem seems to be related to TAJO-485.

Could you show me an SQL example? I would like to reproduce this problem.

> 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)

Reply via email to