You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Steven Phillips (JIRA)" <ji...@apache.org> on 2014/10/07 22:12:36 UTC
[jira] [Commented] (DRILL-1393) Wrong result for query with Having
filter, Order-by and Limit
[ https://issues.apache.org/jira/browse/DRILL-1393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14162446#comment-14162446 ]
Steven Phillips commented on DRILL-1393:
----------------------------------------
Can you modify the test you added to use the testSql() method instead of test(), and verify the record count?
> Wrong result for query with Having filter, Order-by and Limit
> -------------------------------------------------------------
>
> Key: DRILL-1393
> URL: https://issues.apache.org/jira/browse/DRILL-1393
> Project: Apache Drill
> Issue Type: Bug
> Components: Execution - Operators
> Affects Versions: 0.5.0
> Reporter: Aman Sinha
> Assignee: DrillCommitter
> Attachments: DRILL-1393.patch
>
>
> The following query without LIMIT gives correct results:
> 0: jdbc:drill:zk=local> select o_custkey from orders group by o_custkey having o_custkey < 10 order by o_custkey;
> +------------+
> | o_custkey |
> +------------+
> | 1 |
> | 2 |
> | 4 |
> | 5 |
> | 7 |
> | 8 |
> +------------+
> Adding a LIMIT gives 0 rows:
> 0: jdbc:drill:zk=local> select o_custkey from orders group by o_custkey having o_custkey < 10 order by o_custkey limit 10;
> +------------+
> | o_custkey |
> +------------+
> +------------+
> No rows selected
> Here's the EXPLAIN plan:
> 0: jdbc:drill:zk=local> explain plan for select o_custkey from orders group by o_custkey having o_custkey < 10 order by o_custkey limit 10;
> +------------+------------+
> | text | json |
> +------------+------------+
> | 00-00 Screen
> 00-01 SelectionVectorRemover
> 00-02 Limit(fetch=[10])
> 00-03 SelectionVectorRemover
> 00-04 TopN(limit=[10])
> 00-05 Filter(condition=[<($0, 10)])
> 00-06 HashAgg(group=[{0}])
> 00-07 HashAgg(group=[{0}])
> 00-08 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=file:/Users/asinha/data/tpch-sf1/orders]], selectionRoot=/Users/asinha/data/tpch-sf1/orders, columns=[SchemaPath [`o_custkey`]]]])
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)