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

Hudson commented on PHOENIX-1749:
---------------------------------

SUCCESS: Integrated in Phoenix-master #676 (See 
[https://builds.apache.org/job/Phoenix-master/676/])
PHOENIX-1749 ORDER BY should support ordinal position as well as expression 
(Alicia Ying Shu) (jtaylor: rev 795debfe568206bc9a90c15c6acf628c4f9460d4)
* phoenix-core/src/test/java/org/apache/phoenix/compile/QueryOptimizerTest.java
* phoenix-core/src/it/java/org/apache/phoenix/end2end/OrderByIT.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/QueryCompiler.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/OrderByCompiler.java


> ORDER BY should support ordinal position as well as expression
> --------------------------------------------------------------
>
>                 Key: PHOENIX-1749
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1749
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Serhiy Bilousov
>            Assignee: Alicia Ying Shu
>             Fix For: 5.0.0, 4.4.0
>
>         Attachments: PHOENIX-1749-v1.patch, PHOENIX-1749-v3.patch, 
> PHOENIX-1749.patch, Phoenix-1749-v2.patch
>
>
> In postgreSQL (and many others DBs) you can specify not only column name for 
> the ORDER BY but column number (position in SELECT part) as well as column 
> alias.
> see:
> http://www.postgresql.org/docs/9.4/static/queries-order.html
> http://www.postgresql.org/docs/9.4/static/sql-select.html#SQL-GROUPBY
> Adding such support would be very helpful and sometimes necessary.
> I can provide real queries example if required but basically we want 
> something like this
> given query
> SELECT a, b, TRUNC(current_date(),'HOUR') AS date_truncated FROM table 
> we want 
> ORDER BY 1 ASC, 2 DESC
> ORDER BY date_truncated 
> Having just column number would cover both but having column alias would make 
> queries more readable and human friendly. Plus make it one little stem closer 
> to postgreSQL and SQL standard.



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

Reply via email to