drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jinfeng Ni (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-3731) Partition Pruning not taking place when we have case statement within the filter
Date Wed, 02 Sep 2015 17:04:45 GMT

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

Jinfeng Ni commented on DRILL-3731:
-----------------------------------

I understand the partition pruning should work for this filter. But why can user simply the
filter containing the case expression for now:

{code}
where case when dir0=1991 then null else 1 end is null or dir0=1992;

=> 
 where dir0=1991l or dir0=1992;
{code}

If there are way to simply the filter and make partition pruning work, I would suggest we
do so. 




> Partition Pruning not taking place when we have case statement within the filter
> --------------------------------------------------------------------------------
>
>                 Key: DRILL-3731
>                 URL: https://issues.apache.org/jira/browse/DRILL-3731
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 1.2.0
>            Reporter: Rahul Challapalli
>            Assignee: Jinfeng Ni
>             Fix For: 1.2.0
>
>         Attachments: lineitempart.tgz
>
>
> Commit # 8f33c3d55228a98ea2a309490ecbfb7a180f012c
> Partition Pruning is not taking place in the below query
> {code}
> explain plan for select count(*) from `/drill/testdata/partition_pruning/dfs/lineitempart`
where case when dir0=1991 then null else 1 end is null or dir0=1992;
> 00-00    Screen
> 00-01      Project(EXPR$0=[$0])
> 00-02        StreamAgg(group=[{}], EXPR$0=[COUNT()])
> 00-03          Project($f0=[0])
> 00-04            SelectionVectorRemover
> 00-05              Filter(condition=[OR(IS NULL(CASE(=($0, 1991), null, 1)), =($0, 1992))])
> 00-06                Scan(groupscan=[EasyGroupScan [selectionRoot=maprfs:/drill/testdata/partition_pruning/dfs/lineitempart,
numFiles=7, columns=[`dir0`], files=[maprfs:/drill/testdata/partition_pruning/dfs/lineitempart/1991/lineitemaa.tbl,
maprfs:/drill/testdata/partition_pruning/dfs/lineitempart/1992/lineitemab.tbl, maprfs:/drill/testdata/partition_pruning/dfs/lineitempart/1996/lineitemaf.tbl,
maprfs:/drill/testdata/partition_pruning/dfs/lineitempart/1994/lineitemad.tbl, maprfs:/drill/testdata/partition_pruning/dfs/lineitempart/1993/lineitemac.tbl,
maprfs:/drill/testdata/partition_pruning/dfs/lineitempart/1997/lineitemag.tbl, maprfs:/drill/testdata/partition_pruning/dfs/lineitempart/1995/lineitemae.tbl]]])
> {code}
> The planner should have pruned all partitions except 1991 & 1992
> I attached the dataset. Let me know if you need anything.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message