[
https://issues.apache.org/jira/browse/DRILL-4308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15116604#comment-15116604
]
Jason Altekruse commented on DRILL-4308:
----------------------------------------
[~amansinha100] One of these queries is possible today, the other should be
simple to implement by exposing the same information given in "show files"
command in a way that can have a filter applied to it (today it isn't really a
query, it's a special case). As show files includes a field isDirectory, this
should be as simple as apply a filter to this data.
the first can be written as: select dir0 from largetable where dir0 = maxdir()
limit 1
> Aggregate operations on dir<N> columns can be more efficient for certain use
> cases
> ----------------------------------------------------------------------------------
>
> Key: DRILL-4308
> URL: https://issues.apache.org/jira/browse/DRILL-4308
> Project: Apache Drill
> Issue Type: Improvement
> Components: Execution - Relational Operators
> Affects Versions: 1.4.0
> Reporter: Aman Sinha
>
> For queries that perform plain aggregates or DISTINCT operations on the
> directory partition columns (dir0, dir1 etc.) and there are no other columns
> referenced in the query, the performance could be substantially improved by
> not having to scan the entire dataset.
> Consider the following types of queries:
> {noformat}
> select min(dir0) from largetable;
> select distinct dir0 from largetable;
> {noformat}
> The number of distinct values of dir<N> columns is typically quite small and
> there's no reason to scan the large table. This is also come as user
> feedback from some Drill users. Of course, if there's any other column
> referenced in the query (WHERE, ORDER-BY etc.) then we cannot apply this
> optimization.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)