[ 
https://issues.apache.org/jira/browse/PHOENIX-1826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Taylor updated PHOENIX-1826:
----------------------------------
    Attachment: PHOENIX-1826.patch

[~maryannxue] - would you mind reviewing this patch. Main changes are:
- re-implement order preserving tracker in OrderPreservingTracker using 
Expression visitor instead of parse node visitor. See one workaround noted in 
code there for UNION ALL.
- as a result, use order of GROUP BY expressions as tie-breaker for order of 
expressions to form group by key(this facilitated a number of changes in the 
explain plan tests).
- this fixes numerous bugs in tracking whether or not order is preserved
- also uncovered an optimization to not do the client-side sort in a DISTINCT 
or GROUP BY query if we're ordering in the same way that ORDER BY is ordering 
(this facilitated a number of changes in the explain plan tests). Note that we 
could do more here - order the GROUP BY to match the ORDER BY, for example.

> Implement TrackOrderPreservingExpressionCompiler as Expression visitor 
> instead of ParseNode visitor
> ---------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-1826
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1826
>             Project: Phoenix
>          Issue Type: Task
>            Reporter: James Taylor
>         Attachments: PHOENIX-1826.patch
>
>
> We currently traverse the ORDER BY ParseNodes in 
> TrackOrderPreservingExpressionCompiler to determine if the rows will be 
> ordered in row key order. This complicates supporting ORDER BY expressions 
> that are an ordinal position (PHOENIX-1749), since it's a fair bit of code to 
> manufacture a ParseNode when wildcards are used in the select. We should 
> consider writing this visitor as an Expression instead and then using ordinal 
> position would be easy as we could index into the RowProjector to get an 
> Expression. See ViewWhereExpressionVisitor in CreateTableCompiler for an 
> example.



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

Reply via email to