[jira] [Updated] (CASSANDRA-17704) Cannot specify ORDER BY of clustering columns after IN-clause constraints on clustering prefix

2022-08-22 Thread Abe Ratnofsky (Jira)


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

Abe Ratnofsky updated CASSANDRA-17704:
--
Resolution: (was: Not A Problem)
Status: Open  (was: Resolved)

This behavior is feasible - I've put together a branch with passing unit tests: 
[https://github.com/apache/cassandra/compare/trunk...aratno:cassandra:CASSANDRA-17704-order-by-after-in-clustering]

 

Would someone be able to re-open this one and comment here on the questions 
posed in StatementRestrictions.clusteringKeyPrefixIsIn?

> Cannot specify ORDER BY of clustering columns after IN-clause constraints on 
> clustering prefix
> --
>
> Key: CASSANDRA-17704
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17704
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Semantics
>Reporter: Abe Ratnofsky
>Assignee: Abe Ratnofsky
>Priority: Normal
>
> When a user specifies a partition key and clustering key prefix with equality 
> predicates, C* supports sorting by the next clustering key (CASSANDRA-10271):
> {code:java}
> SELECT * FROM tbl WHERE pk = 1 AND ck1 = 1 ORDER BY ck2;{code}
>  
> When a user specifies a partition key with a set-membership predicate, C* 
> supports sorting by the next clustering key (requires merge sort of results 
> for each pk):
> {code:java}
> SELECT * FROM tbl WHERE pk IN (1, 2) ORDER BY ck1;{code}
>  
> But when a user specifies a partition key with an equality predicate and a 
> clustering key prefix with a set membership predicate, C* *does not* support 
> sorting by the next clustering key:
> {code:java}
> SELECT * FROM tbl WHERE pk = 1 AND ck1 IN (1, 2) ORDER BY ck2;
> org.apache.cassandra.exceptions.InvalidRequestException: Order by currently 
> only supports the ordering of columns following their declared order in the 
> PRIMARY KEY
> {code}
>  
> This last situation requires a merge sort, but so does the multi-pk situation.
>  
> The docs seem to indicate that this pattern is supported, as well: 
> [https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useQueryIN.html]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17704) Cannot specify ORDER BY of clustering columns after IN-clause constraints on clustering prefix

2022-07-15 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer updated CASSANDRA-17704:
---
Resolution: Not A Problem
Status: Resolved  (was: Triage Needed)

> Cannot specify ORDER BY of clustering columns after IN-clause constraints on 
> clustering prefix
> --
>
> Key: CASSANDRA-17704
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17704
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Semantics
>Reporter: Abe Ratnofsky
>Assignee: Abe Ratnofsky
>Priority: Normal
>
> When a user specifies a partition key and clustering key prefix with equality 
> predicates, C* supports sorting by the next clustering key (CASSANDRA-10271):
> {code:java}
> SELECT * FROM tbl WHERE pk = 1 AND ck1 = 1 ORDER BY ck2;{code}
>  
> When a user specifies a partition key with a set-membership predicate, C* 
> supports sorting by the next clustering key (requires merge sort of results 
> for each pk):
> {code:java}
> SELECT * FROM tbl WHERE pk IN (1, 2) ORDER BY ck1;{code}
>  
> But when a user specifies a partition key with an equality predicate and a 
> clustering key prefix with a set membership predicate, C* *does not* support 
> sorting by the next clustering key:
> {code:java}
> SELECT * FROM tbl WHERE pk = 1 AND ck1 IN (1, 2) ORDER BY ck2;
> org.apache.cassandra.exceptions.InvalidRequestException: Order by currently 
> only supports the ordering of columns following their declared order in the 
> PRIMARY KEY
> {code}
>  
> This last situation requires a merge sort, but so does the multi-pk situation.
>  
> The docs seem to indicate that this pattern is supported, as well: 
> [https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useQueryIN.html]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17704) Cannot specify ORDER BY of clustering columns after IN-clause constraints on clustering prefix

2022-06-21 Thread Abe Ratnofsky (Jira)


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

Abe Ratnofsky updated CASSANDRA-17704:
--
Component/s: (was: Documentation)

> Cannot specify ORDER BY of clustering columns after IN-clause constraints on 
> clustering prefix
> --
>
> Key: CASSANDRA-17704
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17704
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Semantics
>Reporter: Abe Ratnofsky
>Priority: Normal
>
> When a user specifies a partition key and clustering key prefix with equality 
> predicates, C* supports sorting by the next clustering key (CASSANDRA-10271):
> {code:java}
> SELECT * FROM tbl WHERE pk = 1 AND ck1 = 1 ORDER BY ck2;{code}
>  
> When a user specifies a partition key with a set-membership predicate, C* 
> supports sorting by the next clustering key (requires merge sort of results 
> for each pk):
> {code:java}
> SELECT * FROM tbl WHERE pk IN (1, 2) ORDER BY ck1;{code}
>  
> But when a user specifies a partition key with an equality predicate and a 
> clustering key prefix with a set membership predicate, C* *does not* support 
> sorting by the next clustering key:
> {code:java}
> SELECT * FROM tbl WHERE pk = 1 AND ck1 IN (1, 2) ORDER BY ck2;
> org.apache.cassandra.exceptions.InvalidRequestException: Order by currently 
> only supports the ordering of columns following their declared order in the 
> PRIMARY KEY
> {code}
>  
> This last situation requires a merge sort, but so does the multi-pk situation.
>  
> The docs seem to indicate that this pattern is supported, as well: 
> [https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useQueryIN.html]



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17704) Cannot specify ORDER BY of clustering columns after IN-clause constraints on clustering prefix

2022-06-21 Thread Abe Ratnofsky (Jira)


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

Abe Ratnofsky updated CASSANDRA-17704:
--
Description: 
When a user specifies a partition key and clustering key prefix with equality 
predicates, C* supports sorting by the next clustering key (CASSANDRA-10271):
{code:java}
SELECT * FROM tbl WHERE pk = 1 AND ck1 = 1 ORDER BY ck2;{code}
 
When a user specifies a partition key with a set-membership predicate, C* 
supports sorting by the next clustering key (requires merge sort of results for 
each pk):
{code:java}
SELECT * FROM tbl WHERE pk IN (1, 2) ORDER BY ck1;{code}
 
But when a user specifies a partition key with an equality predicate and a 
clustering key prefix with a set membership predicate, C* *does not* support 
sorting by the next clustering key:
{code:java}
SELECT * FROM tbl WHERE pk = 1 AND ck1 IN (1, 2) ORDER BY ck2;
org.apache.cassandra.exceptions.InvalidRequestException: Order by currently 
only supports the ordering of columns following their declared order in the 
PRIMARY KEY
{code}
 
This last situation requires a merge sort, but so does the multi-pk situation.
 
The docs seem to indicate that this pattern is supported, as well: 
[https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useQueryIN.html]

  was:
When a user specifies a partition key and clustering key prefix with equality 
predicates, C* supports sorting by the next clustering key (CASSANDRA-10271):
SELECT * FROM tbl WHERE pk = 1 AND ck1 = 1 ORDER BY ck2;
 
When a user specifies a partition key with a set-membership predicate, C* 
supports sorting by the next clustering key (requires merge sort of results for 
each pk):
SELECT * FROM tbl WHERE pk IN (1, 2) ORDER BY ck1;
 
But when a user specifies a partition key with an equality predicate and a 
clustering key prefix with a set membership predicate, C* *does not* support 
sorting by the next clustering key:
SELECT * FROM tbl WHERE pk = 1 AND ck1 IN (1, 2) ORDER BY ck2;

org.apache.cassandra.exceptions.InvalidRequestException: Order by currently 
only supports the ordering of columns following their declared order in the 
PRIMARY KEY
 
This last situation requires a merge sort, but so does the multi-pk situation.
 
The docs seem to indicate that this pattern is supported, as well: 
https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useQueryIN.html


> Cannot specify ORDER BY of clustering columns after IN-clause constraints on 
> clustering prefix
> --
>
> Key: CASSANDRA-17704
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17704
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Semantics, Documentation
>Reporter: Abe Ratnofsky
>Priority: Normal
>
> When a user specifies a partition key and clustering key prefix with equality 
> predicates, C* supports sorting by the next clustering key (CASSANDRA-10271):
> {code:java}
> SELECT * FROM tbl WHERE pk = 1 AND ck1 = 1 ORDER BY ck2;{code}
>  
> When a user specifies a partition key with a set-membership predicate, C* 
> supports sorting by the next clustering key (requires merge sort of results 
> for each pk):
> {code:java}
> SELECT * FROM tbl WHERE pk IN (1, 2) ORDER BY ck1;{code}
>  
> But when a user specifies a partition key with an equality predicate and a 
> clustering key prefix with a set membership predicate, C* *does not* support 
> sorting by the next clustering key:
> {code:java}
> SELECT * FROM tbl WHERE pk = 1 AND ck1 IN (1, 2) ORDER BY ck2;
> org.apache.cassandra.exceptions.InvalidRequestException: Order by currently 
> only supports the ordering of columns following their declared order in the 
> PRIMARY KEY
> {code}
>  
> This last situation requires a merge sort, but so does the multi-pk situation.
>  
> The docs seem to indicate that this pattern is supported, as well: 
> [https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useQueryIN.html]



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org