dcapwell commented on code in PR #3872:
URL: https://github.com/apache/cassandra/pull/3872#discussion_r1943888687
##########
test/unit/org/apache/cassandra/cql3/validation/operations/AggregationTest.java:
##########
@@ -180,6 +180,58 @@ public void testCountStarFunction() throws Throwable
assertRows(execute("SELECT max(b), COUNT(1), b FROM %s WHERE a = 1
LIMIT 2"), row(5, 4L, 1));
}
+ @Test
+ public void testMaxAggregationDescending()
+ {
+ createTable("CREATE TABLE %s (a int, b int, primary key (a, b)) WITH
CLUSTERING ORDER BY (b DESC)");
+
+ execute("INSERT INTO %s (a, b) VALUES (1, 1000)");
+ execute("INSERT INTO %s (a, b) VALUES (2, 100)");
+ execute("INSERT INTO %s (a, b) VALUES (4, 1)");
+
+ assertRows(execute("SELECT count(b), max(b) as max FROM %s"),
+ row(3L, 1000));
+ }
+
+ @Test
+ public void testMinAggregationDescending()
+ {
+ createTable("CREATE TABLE %s (a int, b int, primary key (a, b)) WITH
CLUSTERING ORDER BY (b DESC)");
+
+ execute("INSERT INTO %s (a, b) VALUES (1, 1000)");
+ execute("INSERT INTO %s (a, b) VALUES (2, 100)");
+ execute("INSERT INTO %s (a, b) VALUES (4, 1)");
+
+ assertRows(execute("SELECT count(b), min(b) as max FROM %s"),
Review Comment:
```suggestion
assertRows(execute("SELECT count(b), min(b) as min FROM %s"),
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]