[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15141014#comment-15141014 ] Sylvain Lebresne commented on CASSANDRA-7281: - lgtm, +1 (probably needs a minor rebasing though before committing). > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 3.4, 2.2.x, 3.0.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v5.patch, > 0001-Some-tests-for-CASSANDRA-7281.patch, 7281_unit_tests.txt > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15118917#comment-15118917 ] Benjamin Lerer commented on CASSANDRA-7281: --- ||patch||utests||dtests|| |[2.2|https://github.com/apache/cassandra/compare/trunk...blerer:7281-2.2]|[2.2|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-7281-2.2-testall/]|[2.2|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-7281-2.2-dtest/]| |[3.0|https://github.com/apache/cassandra/compare/trunk...blerer:7281-3.0]|[3.0|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-7281-3.0-testall/]|[3.0|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-7281-3.0-dtest/]| |[3.3|https://github.com/apache/cassandra/compare/trunk...blerer:7281-3.3]|[3.3|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-7281-3.3-testall/]|[3.3|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-7281-3.3-dtest/]| |[trunk|https://github.com/apache/cassandra/compare/trunk...blerer:7281-trunk]|[trunk|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-7281-trunk-testall/]|[trunk|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-7281-trunk-dtest/]| [~slebresne] could you review? The patch for 2.2 is the same as before. It has just been rebased. The patch for 3.0 is different for {{MultiCBuilder}}, {{PrimaryKeyRestrictionSet}} and {{PrimaryKeyRestrictionSetTest}} due to the changes of CASSANDRA-8099. The patch for 3.3 differs from the one of 3.0 for {{MultiCBuilder}} and {{PrimaryKeyRestrictionSet}} due to the changes of CASSANDRA-10409 which modified {{MultiCBuilder}}. The patch for trunk is the same as the one of 3.3. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 3.3, 2.2.x, 3.0.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v5.patch, > 0001-Some-tests-for-CASSANDRA-7281.patch, 7281_unit_tests.txt > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15115316#comment-15115316 ] Benjamin Lerer commented on CASSANDRA-7281: --- Thanks for the work. The code freeze for 3.3 will be next monday. By consequence, end of week will probably be too late for the review process. I will take it over. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 3.3, 2.2.x, 3.0.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v5.patch, > 0001-Some-tests-for-CASSANDRA-7281.patch, 7281_unit_tests.txt > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15114522#comment-15114522 ] Marcin Szymaniuk commented on CASSANDRA-7281: - To be honest I underestimated time I need to get familiar with 3.x. There are some significant changes around bounds. So far I just rewritten some test Benjamin added. Depends on your schedule, I will have a look at it later this week/weekend but I understand it might be too late for your release. Please let me know if you decide you start working on this on your own so I don't do it in parallel. I'm attaching two tests I rewritten - It can save you some typing. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 3.3, 2.2.x, 3.0.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v5.patch, > 7281_unit_tests.txt > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15108830#comment-15108830 ] Benjamin Lerer commented on CASSANDRA-7281: --- It would be perfect. :-) > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 3.3, 2.2.x, 3.0.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v5.patch, > 7281_unit_tests.txt > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15108230#comment-15108230 ] Marcin Szymaniuk commented on CASSANDRA-7281: - I will do it over the weekend if it's not too late for you. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 3.3, 2.2.x, 3.0.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v5.patch, > 7281_unit_tests.txt > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15095858#comment-15095858 ] Benjamin Lerer commented on CASSANDRA-7281: --- [~marcinszymaniuk] do you have time to make the patches for 3.0 and 3.3 in the coming days? We would like to have this ticket fixed for the 3.3 release. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v5.patch, > 7281_unit_tests.txt > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15094027#comment-15094027 ] Sylvain Lebresne commented on CASSANDRA-7281: - Had a look at [~blerer]'s modified version and it looks good, but we obviously need patches for 3.0 and upwards (as well as links to the CI results). I don't think we'll want to commit this to 2.1 at this point however, so I suggest not wasting time on that. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v5.patch, > 7281_unit_tests.txt > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15034102#comment-15034102 ] Marcin Szymaniuk commented on CASSANDRA-7281: - I'm still interested. I will have a look at your patch. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v5.patch, > 7281_unit_tests.txt > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15027102#comment-15027102 ] Benjamin Lerer commented on CASSANDRA-7281: --- [~marcinszymaniuk] do you have any comments on my modified version? Are you still interested in providing a patch for 2.1 and 3.0? > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v5.patch, > 7281_unit_tests.txt > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14966879#comment-14966879 ] Benjamin Lerer commented on CASSANDRA-7281: --- Sorry for not reviewing the patch sooner. Your patch suffer from the same problem as I mentionned earlier. It will not work with a mix of single and multi column restrictions like: {{SELECT * FROM myTable WHERE partitionKey = 1 AND clustering_1 IN (1, 2) AND clustering_2 = 0 AND (clustering_3, clustering_4) > (2, 3);}} Another problem is that a big part of the code in {{PrimaryKeyRestrictionSet}} is relative to {{MultiColumnRestrictions}} and should be in my opinion encapsulate within it. Having this code within {{PrimaryKeyRestrictionSet}} will make the implementation of an issue like CASSANDRA-8855 much more complicated. I have pushed modified version of the patch for 2.2 [here|https://github.com/apache/cassandra/compare/trunk...blerer:7281-2.2] (it runs fine on CI). Feel free to provide some feedbacks on it. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v5.patch, > 7281_unit_tests.txt > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14587132#comment-14587132 ] Stefania commented on CASSANDRA-7281: - Thanks! > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch, > 7281_unit_tests.txt > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14586621#comment-14586621 ] Marcin Szymaniuk commented on CASSANDRA-7281: - All right. I will merge it with unit tests I already have (It might be that those from dtest are not necessary anymore). > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch, > 7281_unit_tests.txt > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14568783#comment-14568783 ] Benjamin Lerer commented on CASSANDRA-7281: --- Sorry, my comment was really not that clear. In 2.1: I think that your code should tackle the problem within the {{SelectStatement.buildBound}} method. The tests for that method are within {{SelectStatementTest}}. In 2.2 you are right the code should be within {{MultiColumnRestriction.Slice.appendBoundTo}} method and the tests are within {{PrimaryKeyRestrictionSetTest }}. I expect that if you manage to fix the problem in 2.1 as part of the {{SelectStatement.buildBound}} method you should be able to make it work within 2.2 without too much difficulties by extracting your fix and putting it within {{MultiColumnRestriction.Slice.appendBoundTo}}. Hope it helps. Do not hesitate to contact me on IRC or by email if you have more questions > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14568757#comment-14568757 ] Marcin Szymaniuk commented on CASSANDRA-7281: - In 2.2 I cannot see classes/methods mentioned in your comment. >From quick look it seems to me that: - MultiColumnRestriction.Slice#appendBoundTo is the place to implement the logic - PrimaryKeyRestrictionSetTest is good place to create more of unit-style tests. Can you please have a look and confirm? > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14561779#comment-14561779 ] Marcin Szymaniuk commented on CASSANDRA-7281: - Ok I will have a look. I guess we should change Fix Version/s then? > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14561778#comment-14561778 ] Marcin Szymaniuk commented on CASSANDRA-7281: - Ok I will have a look. I guess we should change Fix Version/s then? > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14558870#comment-14558870 ] Benjamin Lerer commented on CASSANDRA-7281: --- Thanks for the patch. It is nice that you added all those unit tests. I had a quick look at the patch and I have the following comments: # CASSANDRA-8613 has changed the way things are working. You can now have a mix a tulpe relations and non tulpe relations. This means that you first relation might not be a tulpe relation or a slice tulpe relation. # In 2.2 {{SelectStatement}} has been refactored to simplify the code and allow us to implements more complex features. Your approach of creating new restrictions will not fit properly there. I believe that you should be able to skip this restrictions creation step and implements the logic into {{buildBound}} by going directly from the original restriction to the composites. FYI: The {{buildBond}} unit tests are located in {{SelectStatementTest}}. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14558125#comment-14558125 ] Marcin Szymaniuk commented on CASSANDRA-7281: - I Uploaded a patch yesterday in case you don't get notifications for that. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14558124#comment-14558124 ] Marcin Szymaniuk commented on CASSANDRA-7281: - I Uploaded a patch yesterday in case you don't get notifications for that. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v4.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14550027#comment-14550027 ] Benjamin Lerer commented on CASSANDRA-7281: --- [~marcinszymaniuk] Great! Thanks > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14550010#comment-14550010 ] Marcin Szymaniuk commented on CASSANDRA-7281: - I will provide another patch by the end of this week > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14539576#comment-14539576 ] Benjamin Lerer commented on CASSANDRA-7281: --- [~marcinszymaniuk] Do you still want to provide a patch or should I reasign the issue? The issue has been open for nearly a year and I would like to get rid of it as it is one of the last issues that we have on tuple relations. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.x > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14352704#comment-14352704 ] Marcin Szymaniuk commented on CASSANDRA-7281: - Ok, cool > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.4 > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14350102#comment-14350102 ] Benjamin Lerer commented on CASSANDRA-7281: --- [~marcinszymaniuk] CASSANDRA-8613 as been committed. You are good to go :-) > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.4 > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14300027#comment-14300027 ] Marcin Szymaniuk commented on CASSANDRA-7281: - Sure, I started watching your ticket. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.3, 2.0.13 > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14298609#comment-14298609 ] Benjamin Lerer commented on CASSANDRA-7281: --- [~marcinszymaniuk] I am currently working on CASSANDRA-8613 and the changes requireded for it will impact a lot the code of {{SelectStatement}} used to build the requestedBounds. If you can, it might be better to wait a bit before writing your patch. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.3, 2.0.13 > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14294313#comment-14294313 ] Marcin Szymaniuk commented on CASSANDRA-7281: - Ah yes I will provide another one. I missed your message. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.3, 2.0.13 > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14294121#comment-14294121 ] Benjamin Lerer commented on CASSANDRA-7281: --- [~marcinszymaniuk] do you want to provide another patch or should I reassign the ticket? > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.3, 2.0.13 > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14276925#comment-14276925 ] Benjamin Lerer commented on CASSANDRA-7281: --- * It seems that the patch does not work when the two sides of the slice are specified. Queries like: {code} SELECT * FROM foo WHERE a=0 AND (b) > (0) AND (b) <= (1); {code} or {code} SELECT * FROM %s WHERE a=0 AND (b, c) > (1, 0) AND (b, c) < (2, 0); {code} do not returns the good rows. * It would be good to also add some unit tests to {{MultiColumnRelationTest}} to cover all of the possible cases * The code is quite heavy and will not merge in 3.0 due to the {{SelectStatement}} refactoring.You should be able to fix this ticket by changing only the {{SelectStatement.buildMultiColumnSliceBound}} > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.1.3, 2.0.13 > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14250263#comment-14250263 ] Philip Thompson commented on CASSANDRA-7281: Okay, that is fine. Sylvain mentioned a possible 2.1.3 release by the end of the calendar year. If this patch makes it into that release, that is soon enough. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.0.12, 2.1.3 > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14250245#comment-14250245 ] Benjamin Lerer commented on CASSANDRA-7281: --- I will try but the chances are low. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.0.12 > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14250021#comment-14250021 ] Philip Thompson commented on CASSANDRA-7281: Any chance this could get reviewed before the holidays? > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne >Assignee: Marcin Szymaniuk > Fix For: 2.0.12 > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14227974#comment-14227974 ] Marcin Szymaniuk commented on CASSANDRA-7281: - Ah sorry. Just attached patch for 2.0. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne > Fix For: 2.0.12 > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v3.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14224632#comment-14224632 ] Benjamin Lerer commented on CASSANDRA-7281: --- The ticket is open for the version 2.0 but it seems that the patch has been built for an other version. Marcin, could you backport your fix for version 2.0. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne > Fix For: 2.0.12 > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch, > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-v2.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14215496#comment-14215496 ] Michael Shuler commented on CASSANDRA-7281: --- Missed the dtest comment - send those as a pull request on https://github.com/riptano/cassandra-dtest - thanks! > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne > Fix For: 2.0.12 > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CASSANDRA-7281) SELECT on tuple relations are broken for mixed ASC/DESC clustering order
[ https://issues.apache.org/jira/browse/CASSANDRA-7281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14215488#comment-14215488 ] Michael Shuler commented on CASSANDRA-7281: --- Nit: if you're going to remove lines in {{src/java/org/apache/cassandra/db/filter/ColumnSlice.java}}, remove them, please, don't comment them out. > SELECT on tuple relations are broken for mixed ASC/DESC clustering order > > > Key: CASSANDRA-7281 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7281 > Project: Cassandra > Issue Type: Bug >Reporter: Sylvain Lebresne > Fix For: 2.0.12 > > Attachments: > 0001-CASSANDRA-7281-SELECT-on-tuple-relations-are-broken-.patch > > > As noted on > [CASSANDRA-6875|https://issues.apache.org/jira/browse/CASSANDRA-6875?focusedCommentId=13992153&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13992153], > the tuple notation is broken when the clustering order mixes ASC and DESC > directives because the range of data they describe don't correspond to a > single continuous slice internally. To copy the example from CASSANDRA-6875: > {noformat} > cqlsh:ks> create table foo (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH > CLUSTERING ORDER BY (b DESC, c ASC); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 2, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 0); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 1, 1); > cqlsh:ks> INSERT INTO foo (a, b, c) VALUES (0, 0, 0); > cqlsh:ks> SELECT * FROM foo WHERE a=0; > a | b | c > ---+---+--- > 0 | 2 | 0 > 0 | 1 | 0 > 0 | 1 | 1 > 0 | 0 | 0 > (4 rows) > cqlsh:ks> SELECT * FROM foo WHERE a=0 AND (b, c) > (1, 0); > a | b | c > ---+---+--- > 0 | 2 | 0 > (1 rows) > {noformat} > The last query should really return {{(0, 2, 0)}} and {{(0, 1, 1)}}. > For that specific example we should generate 2 internal slices, but I believe > that with more clustering columns we may have more slices. -- This message was sent by Atlassian JIRA (v6.3.4#6332)