You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Caleb Rackliffe (Jira)" <ji...@apache.org> on 2024/09/03 16:28:00 UTC

[jira] [Updated] (CASSANDRA-19878) Filtering on clustering columns in reversed order with BETWEEN return invalid results

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

Caleb Rackliffe updated CASSANDRA-19878:
----------------------------------------
    Attachment: ci_summary.html

> Filtering on clustering columns in reversed order with BETWEEN return invalid results
> -------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-19878
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19878
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL/Interpreter
>            Reporter: Benjamin Lerer
>            Assignee: Benjamin Lerer
>            Priority: Normal
>             Fix For: 5.x
>
>         Attachments: ci_summary.html
>
>
> As noted by [~maedhroz], filtering on clustering columns in reverser order do not work properly.
> The problem can be reproduced using the following test:
> {code}
> @Test
> public void testReverseAndBetweenMemtableFiltering()
> {
>     createTable("CREATE TABLE %s(p int, c int, c2 int, abbreviation ascii, PRIMARY KEY (p, c, c2)) WITH CLUSTERING ORDER BY (c DESC, c2 DESC)");
>     execute("INSERT INTO %s(p, c, c2, abbreviation) VALUES (0, 1, 1, 'CA')");
>     execute("INSERT INTO %s(p, c, c2, abbreviation) VALUES (0, 2, 2, 'MA')");
>     execute("INSERT INTO %s(p, c, c2, abbreviation) VALUES (0, 3, 3, 'MA')");
>     execute("INSERT INTO %s(p, c, c2, abbreviation) VALUES (0, 4, 4, 'TX')");
>     ResultSet betweenRowsNet = executeNet("SELECT * FROM %s WHERE c2 BETWEEN 2 AND 3 ALLOW FILTERING");
>     assertRowsNet(betweenRowsNet, row (0, 3, 3, "MA"), row (0, 2, 2, "MA")); // NO RESULTS?
> }
> {code}
> The issue is due to the fact that the comparison performed in {{BETWEEN.isSatisfied}} ignore the {{ReversedType}}.



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

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