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

Hanifi Gunes commented on DRILL-1309:
-------------------------------------

Trying this query with a simple filter
{code:sql}
explain plan for
select t1.columns[1] 
from 
dfs.`/Users/hgunes/workspaces/mapr/incubator-drill/data/t1.csv` t1
where t1.columns[0] = 10;
{code}

generates

{panel}
00-00    Screen
00-01      Project(EXPR$0=[ITEM($0, 1)])
00-02        SelectionVectorRemover
00-03          Filter(condition=[=(CAST(ITEM($0, 0)):INTEGER NOT NULL, 10)])
00-04            ProducerConsumer
00-05              Scan(groupscan=[EasyGroupScan [selectionRoot=/data/t1.csv, 
columns = [SchemaPath [`columns`]]]])
{panel}


Looks like we need projection pushdown for csv just like DRILL-1283.



> Projected columns are not pushed into scan 
> -------------------------------------------
>
>                 Key: DRILL-1309
>                 URL: https://issues.apache.org/jira/browse/DRILL-1309
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Mehant Baid
>            Assignee: Hanifi Gunes
>             Fix For: 0.5.0
>
>
> While performing the following query on two text files, the projected column 
> does not get pushed into the scan.
> explain plan for select t1.columns[1] from dfs.`/tmp/t1.csv` t1, 
> dfs.`/tmp/t2.csv` t2 where t1.columns[0] = t2.columns[0]; 
> 00-00    Screen
> 00-01      Project(EXPR$0=[ITEM($0, 1)])
> 00-02        HashJoin(condition=[=($1, $2)], joinType=[inner])
> 00-04          Project(columns=[$0], $f2=[ITEM($0, 0)])
> 00-06            Scan(groupscan=[EasyGroupScan [selectionRoot=/tmp/t1.csv, 
> columns = [SchemaPath [`columns`], SchemaPath [`columns`[0]]]]])
> 00-03          Project($f20=[$0])
> 00-05            Project($f2=[ITEM($0, 0)])
> 00-07              Scan(groupscan=[EasyGroupScan [selectionRoot=/tmp/t2.csv, 
> columns = [SchemaPath [`columns`[0]]]]])
> In the above plan (00-06) we see that the scan contains the following column 
> projections pushed into scan: 'columns' and 'columns[0]'. 
> We should not push 'columns' into the scan, instead push 'columns[1]' which 
> is the projected column into the scan. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to