drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-4825) Wrong data with UNION ALL when querying different sub-directories under the same table
Date Fri, 05 Aug 2016 17:03:20 GMT

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

ASF GitHub Bot commented on DRILL-4825:
---------------------------------------

Github user jinfengni commented on a diff in the pull request:

    https://github.com/apache/drill/pull/559#discussion_r73725537
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/TestPartitionFilter.java ---
    @@ -386,4 +386,49 @@ public void testPartitionFilterWithInSubquery() throws Exception
{
         test("alter session set `planner.in_subquery_threshold` = 10");
         testExcludeFilter(query, 4, "Filter", 40);
       }
    +
    +
    +  @Test // DRILL-4825: querying same table with different filter in UNION ALL.
    +  public void testPruneSameTableInUnionAll() throws Exception {
    +    final String query = String.format("select count(*) as cnt from "
    +        + "( select dir0 from dfs_test.`%s/multilevel/parquet` where dir0 in ('1994')
union all "
    +        + "  select dir0 from dfs_test.`%s/multilevel/parquet` where dir0 in ('1995',
'1996') )",
    +        TEST_RES_PATH, TEST_RES_PATH);
    +
    +    String [] exclued = {"Filter"};
    +
    +    // verify plan that filter is applied in partition pruning.
    +    testPlanMatchingPatterns(query, null, exclued);
    +
    +    // verify we get correct count(*).
    +    testBuilder()
    +        .sqlQuery(query)
    +        .unOrdered()
    +        .baselineColumns("cnt")
    +        .baselineValues((long)120)
    +        .build()
    +        .run();
    +  }
    +
    +  @Test // DRILL-4825: querying same table with different filter in Join.
    +  public void testPruneSameTableInJoin() throws Exception {
    +    final String query = String.format("select *  from "
    +            + "( select sum(o_custkey) as x from dfs_test.`%s/multilevel/parquet` where
dir0 in ('1994') ) join "
    +            + " ( select sum(o_custkey) as y from dfs_test.`%s/multilevel/parquet` where
dir0 in ('1995', '1996')) "
    +            + " on x = y ",
    +        TEST_RES_PATH, TEST_RES_PATH);
    +
    +    String [] exclued = {"Filter"};
    --- End diff --
    
    modified. 


> Wrong data with UNION ALL when querying different sub-directories under the same table
> --------------------------------------------------------------------------------------
>
>                 Key: DRILL-4825
>                 URL: https://issues.apache.org/jira/browse/DRILL-4825
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 1.6.0, 1.7.0, 1.8.0
>            Reporter: Rahul Challapalli
>            Assignee: Jinfeng Ni
>            Priority: Critical
>             Fix For: 1.8.0
>
>         Attachments: l_3level.tgz
>
>
> git.commit.id.abbrev=0700c6b
> The below query returns wrongs results 
> {code}
> select count (*) from (
>   select l_orderkey, dir0 from l_3level t1 where t1.dir0 = 1 and t1.dir1='one' and t1.dir2
= '2015-7-12'
>   union all 
>   select l_orderkey, dir0 from l_3level t2 where t2.dir0 = 1 and t2.dir1='two' and t2.dir2
= '2015-8-12') data;
> +---------+
> | EXPR$0  |
> +---------+
> | 20      |
> +---------+
> {code}
> The wrong result is evident from the output of the below queries
> {code}
> 0: jdbc:drill:zk=10.10.100.190:5181> select count (*) from (select l_orderkey, dir0
from l_3level t2 where t2.dir0 = 1 and t2.dir1='two' and t2.dir2 = '2015-8-12');
> +---------+
> | EXPR$0  |
> +---------+
> | 30      |
> +---------+
> 1 row selected (0.258 seconds)
> 0: jdbc:drill:zk=10.10.100.190:5181> select count (*) from (select l_orderkey, dir0
from l_3level t2 where t2.dir0 = 1 and t2.dir1='one' and t2.dir2 = '2015-7-12');
> +---------+
> | EXPR$0  |
> +---------+
> | 10      |
> +---------+
> {code}
> I attached the data set. Let me know if you need anything more



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

Mime
View raw message