You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Aman Sinha (JIRA)" <ji...@apache.org> on 2014/06/29 20:33:24 UTC
[jira] [Commented] (DRILL-1091) Planner generating invalid plan for
tpc-h 18
[ https://issues.apache.org/jira/browse/DRILL-1091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14047200#comment-14047200 ]
Aman Sinha commented on DRILL-1091:
-----------------------------------
This is actually an issue with trait propagation for Filters. TPCH 18 is doing 2 grouped aggregations. The first grouped aggregation (a hash aggregate) has a HAVING predicate and the filter operator seems to incorrectly produce an output collation trait, so there's no sort enforcer added before the second grouped aggregation (a streaming aggregate).
Here's a simple example to reproduce the same issue. Note that no sort is getting added after the filter even though the input is not sorted and there's an order-by requirement.
explain plan for select n_nationkey from cp.`tpch/nation.parquet` group by n_nationkey having n_nationkey < 5 order by n_nationkey");
00-00 Screen
00-01 SelectionVectorRemover
00-02 Filter(condition=[<($0, 5)])
00-03 HashAgg(group=[{0}])
00-04 ProducerConsumer
00-05 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=/tpch/nation.parquet]], selectionRoot=/tpch/nation.parquet, columns=[SchemaPath [`n_nationkey`]]]])
I am in the process of testing a fix for this.
> Planner generating invalid plan for tpc-h 18
> --------------------------------------------
>
> Key: DRILL-1091
> URL: https://issues.apache.org/jira/browse/DRILL-1091
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Steven Phillips
> Assignee: Aman Sinha
>
> The planner is currently including a streaming aggregate on l_orderkey without previously sorting. This is causing invalid results.
--
This message was sent by Atlassian JIRA
(v6.2#6252)