You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Stefan Miklosovic (Jira)" <ji...@apache.org> on 2025/02/05 19:55:00 UTC
[jira] [Assigned] (CASSANDRA-20295) [Cassandra 5.x] Min/Max aggregation not working
[ https://issues.apache.org/jira/browse/CASSANDRA-20295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stefan Miklosovic reassigned CASSANDRA-20295:
---------------------------------------------
Assignee: Stefan Miklosovic
> [Cassandra 5.x] Min/Max aggregation not working
> -----------------------------------------------
>
> Key: CASSANDRA-20295
> URL: https://issues.apache.org/jira/browse/CASSANDRA-20295
> Project: Apache Cassandra
> Issue Type: Bug
> Components: Legacy/Core, Legacy/Local Write-Read Paths
> Reporter: Artem Golovko
> Assignee: Stefan Miklosovic
> Priority: Normal
> Fix For: 5.0.x, 5.x
>
>
> *Cassandra version*
> 5.0.3
> docker run --name cassandra -d cassandra:5
> docker exec -it cassandra cqlsh
>
> *Data schema*
> {code:java}
> CREATE KEYSPACE IF NOT EXISTS test WITH replication = { 'class': 'SimpleStrategy', 'replication_factor': 1 } AND durable_writes = true;
> USE test;
> CREATE TABLE data(
> sensor_id text,
> time timestamp,
> value double,
> PRIMARY KEY (sensor_id, time)
> ) WITH CLUSTERING ORDER BY (time DESC)
> AND compaction = {'class': 'TimeWindowCompactionStrategy' };
> INSERT INTO data (sensor_id, time, value) VALUES ('s1', 0, 1);
> INSERT INTO data (sensor_id, time, value) VALUES ('s1', 1000, 2);{code}
>
> *Actual result*
> {code:java}
> SELECT min(time), max(time) FROM data WHERE sensor_id = 's1';
> system.min(time) | system.max(time)
> ---------------------------------+---------------------------------
> 1970-01-01 00:00:01.000000+0000 | 1970-01-01 00:00:00.000000+0000(1 rows){code}
>
> {*}Expected result{*}{*}{*}
> On cassandra 4 (tested with 4.1.8) everything is working fine
> {code:java}
> SELECT min(time), max(time) FROM data WHERE sensor_id = 's1';
> system.min(time) | system.max(time)
> ---------------------------------+---------------------------------
> 1970-01-01 00:00:00.000000+0000 | 1970-01-01 00:00:01.000000+0000(1 rows){code}
> *Note*
> If we'll change clustering order from DESC to ASC then problem disappear
--
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