-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/20548/
-----------------------------------------------------------

(Updated April 22, 2014, 7:27 a.m.)


Review request for Tajo.


Summary (updated)
-----------------

TAJO-787: FilterPushDownRule::visitSubQuery does not consider aliased columns.


Bugs: TAJO-787
    https://issues.apache.org/jira/browse/TAJO-787


Repository: tajo


Description
-------

I found a bug for FilterPushDownRule as follows:
* Schema
{code:xml}
default> \d table1;

table name: default.table1
table path: hdfs://localhost:9010/tajo/warehouse/table1
store type: CSV
number of rows: 0
volume: 60 B
Options: 
        'csvfile.delimiter'='|'

schema: 
id      INT4
name    TEXT
score   FLOAT4
type    TEXT


default> \d table2;

table name: default.table2
table path: hdfs://localhost:9010/tajo/warehouse/table2
store type: CSV
number of rows: 0
volume: 61 B
Options: 
        'csvfile.delimiter'='|'

schema: 
id      INT4
name    TEXT
score   FLOAT4
type    TEXT
{code}

* SQL
{code:xml}
select t1.id, t1.name, t1.cnt
from (
  select a.id, a.name, count(*) as cnt
  from table1 a
  group by a.id, a.name
) t1
where t1.cnt > 0
{code}

* Error Message
{code:xml}
java.lang.NullPointerException
        at org.apache.tajo.catalog.Column.equals(Column.java:115)
        at java.util.ArrayList.indexOf(ArrayList.java:216)
        at java.util.ArrayList.contains(ArrayList.java:199)
        at java.util.AbstractCollection.containsAll(AbstractCollection.java:278)
        at org.apache.tajo.catalog.Schema.containsAll(Schema.java:269)
        at 
org.apache.tajo.engine.planner.LogicalPlanner.checkIfBeEvaluatedAtRelation(LogicalPlanner.java:1575)
        at 
org.apache.tajo.engine.planner.rewrite.FilterPushDownRule.visitScan(FilterPushDownRule.java:315)
        at 
org.apache.tajo.engine.planner.rewrite.FilterPushDownRule.visitScan(FilterPushDownRule.java:35)

{code}
If I remove where clause, it will run successfully.


Diffs
-----

  
tajo-core/src/main/java/org/apache/tajo/engine/planner/rewrite/FilterPushDownRule.java
 63b426f 
  tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java 
05c510b 
  tajo-core/src/test/resources/queries/TestSelectQuery/testWhereCond2.sql 
PRE-CREATION 
  tajo-core/src/test/resources/results/TestSelectQuery/testWhereCond2.result 
PRE-CREATION 

Diff: https://reviews.apache.org/r/20548/diff/


Testing
-------

mvn clean install


Thanks,

Jung JaeHwa

Reply via email to