You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jonathan Ellis (Created) (JIRA)" <ji...@apache.org> on 2012/02/16 18:39:02 UTC

[jira] [Created] (CASSANDRA-3925) ORDER BY syntax

ORDER BY syntax
---------------

                 Key: CASSANDRA-3925
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3925
             Project: Cassandra
          Issue Type: Sub-task
            Reporter: Jonathan Ellis
            Assignee: Sylvain Lebresne
            Priority: Minor
             Fix For: 1.1.1


I think we should switch to standard {{ORDER BY x [DESC]}} syntax, for several reasons.

First, because {{ORDER [DESC]}} is not very readable.  By that I mean, you have no idea what it means unless you cross reference with the CF definition.

Second, because it's not a sufficiently better fit than the SQL syntax to justify inventing our own.

Third (and this is the big one) I strongly suspect that we're going to start supporting at least limited run-time ordering in the near future, and this gives us some future proofing while working reasonably well in the meantime: we can simply reject with IRE {{ORDER BY}} requests that aren't compatible with the comparator, similarly to what we used to do with unindexed WHERE expressions.  (Which is also a good example of us being dragged kicking and screaming into being more flexible at query time...)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-3925) ORDER BY syntax

Posted by "Jonathan Ellis (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13210547#comment-13210547 ] 

Jonathan Ellis edited comment on CASSANDRA-3925 at 2/17/12 8:52 PM:
--------------------------------------------------------------------

+1
                
      was (Author: jbellis):
    Wouldn't {{name.position == 1}} be better than {{name.position != 0}} when dealing with PKs of more than 2 components?
                  
> ORDER BY syntax
> ---------------
>
>                 Key: CASSANDRA-3925
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3925
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Jonathan Ellis
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 1.1.1
>
>         Attachments: 3925.txt
>
>
> I think we should switch to standard {{ORDER BY x [DESC]}} syntax, for several reasons.
> First, because {{ORDER [DESC]}} is not very readable.  By that I mean, you have no idea what it means unless you cross reference with the CF definition.
> Second, because it's not a sufficiently better fit than the SQL syntax to justify inventing our own.
> Third (and this is the big one) I strongly suspect that we're going to start supporting at least limited run-time ordering in the near future, and this gives us some future proofing while working reasonably well in the meantime: we can simply reject with IRE {{ORDER BY}} requests that aren't compatible with the comparator, similarly to what we used to do with unindexed WHERE expressions.  (Which is also a good example of us being dragged kicking and screaming into being more flexible at query time...)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3925) ORDER BY syntax

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13210547#comment-13210547 ] 

Jonathan Ellis commented on CASSANDRA-3925:
-------------------------------------------

Wouldn't {{name.position == 1}} be better than {{name.position != 0}} when dealing with PKs of more than 2 components?
                
> ORDER BY syntax
> ---------------
>
>                 Key: CASSANDRA-3925
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3925
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Jonathan Ellis
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 1.1.1
>
>         Attachments: 3925.txt
>
>
> I think we should switch to standard {{ORDER BY x [DESC]}} syntax, for several reasons.
> First, because {{ORDER [DESC]}} is not very readable.  By that I mean, you have no idea what it means unless you cross reference with the CF definition.
> Second, because it's not a sufficiently better fit than the SQL syntax to justify inventing our own.
> Third (and this is the big one) I strongly suspect that we're going to start supporting at least limited run-time ordering in the near future, and this gives us some future proofing while working reasonably well in the meantime: we can simply reject with IRE {{ORDER BY}} requests that aren't compatible with the comparator, similarly to what we used to do with unindexed WHERE expressions.  (Which is also a good example of us being dragged kicking and screaming into being more flexible at query time...)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3925) ORDER BY syntax

Posted by "Sylvain Lebresne (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne updated CASSANDRA-3925:
----------------------------------------

    Attachment: 3925.txt

Ok, I can get convinced by that. Of course the only downside is that to start with, there will be no choice on which column you can do the ORDER BY on, which may feel a little weird at first. Anyway, patch attached to do the change. It's rather minimal since it really just change the syntax and validate that you've picked up *the* right column. The exact syntax accepted is "ORDER BY x (ASC | DESC)?".
                
> ORDER BY syntax
> ---------------
>
>                 Key: CASSANDRA-3925
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3925
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Jonathan Ellis
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 1.1.1
>
>         Attachments: 3925.txt
>
>
> I think we should switch to standard {{ORDER BY x [DESC]}} syntax, for several reasons.
> First, because {{ORDER [DESC]}} is not very readable.  By that I mean, you have no idea what it means unless you cross reference with the CF definition.
> Second, because it's not a sufficiently better fit than the SQL syntax to justify inventing our own.
> Third (and this is the big one) I strongly suspect that we're going to start supporting at least limited run-time ordering in the near future, and this gives us some future proofing while working reasonably well in the meantime: we can simply reject with IRE {{ORDER BY}} requests that aren't compatible with the comparator, similarly to what we used to do with unindexed WHERE expressions.  (Which is also a good example of us being dragged kicking and screaming into being more flexible at query time...)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira