Jay Aurthur created CASSANDRA-20027:
---------------------------------------
Summary: Cassandra 5 min() and max() results incorrect when
cluster order desc
Key: CASSANDRA-20027
URL: https://issues.apache.org/jira/browse/CASSANDRA-20027
Project: Cassandra
Issue Type: Bug
Reporter: Jay Aurthur
Attachments: image-2024-10-24-13-57-26-947.png
Given:
CREATE TABLE min_max_bigint_desc(id text, created bigint, PRIMARY KEY (id,
created)) WITH CLUSTERING ORDER BY (created DESC);
CREATE TABLE min_max_bigint_asc(id text, created bigint, PRIMARY KEY (id,
created)) WITH CLUSTERING ORDER BY (created ASC);
SELECT * FROM min_max_bigint_asc;
id | created
----+---------
0 | 1
0 | 2
0 | 3
and data in both tables for both Cassandra 5 and 4, the same:
SHOW VERSION;SELECT id,min(created),max(created) FROM min_max_bigint_asc WHERE
id='0';SELECT id,min(created),max(created) FROM min_max_bigint_desc WHERE
id='0';
[cqlsh 6.2.0 | Cassandra 5.0.2 | CQL spec 3.4.7 | Native protocol v5]
id | system.min(created) | system.max(created)
----+---------------------+---------------------
0 | 1 | 3
id | system.min(created) | system.max(created)
----+---------------------+---------------------
0 | 3 | 1
[cqlsh 6.1.0 | Cassandra 4.1.7 | CQL spec 3.4.6 | Native protocol v5]
id | system.min(created) | system.max(created)
----+---------------------+---------------------
0 | 1 | 3
id | system.min(created) | system.max(created)
----+---------------------+---------------------
0 | 1 | 3
bigint and timestamp column types have the same behavior, and likely others but
not explicitly verified.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]