yifan-c commented on code in PR #1739:
URL: https://github.com/apache/cassandra/pull/1739#discussion_r943989630
##########
test/unit/org/apache/cassandra/cql3/validation/entities/WritetimeOrTTLTest.java:
##########
@@ -1050,6 +1052,47 @@ public void testFrozenNestedUDTs() throws Throwable
assertWritetimeAndTTL("t.f2.f2", "k=12", TIMESTAMP_1, TTL_1);
}
+ @Test
+ public void testFunctions() throws Throwable
+ {
+ createTable("CREATE TABLE %s (k int PRIMARY KEY, v int, s set<int>, fs
frozen<set<int>>)");
+ execute("INSERT INTO %s (k, v, s, fs) VALUES (0, 0, {1, 2, 3}, {1, 2,
3}) USING TIMESTAMP 1 AND TTL 1000");
+ execute("INSERT INTO %s (k, v, s, fs) VALUES (1, 1, {10, 20, 30}, {10,
20, 30}) USING TIMESTAMP 10 AND TTL 1000");
+ execute("UPDATE %s USING TIMESTAMP 2 AND TTL 2000 SET s = s + {2, 3}
WHERE k = 0");
+ execute("UPDATE %s USING TIMESTAMP 20 AND TTL 2000 SET s = s + {20,
30} WHERE k = 1");
+
+ // Regular column
+ assertRows("SELECT min(v) FROM %s", row(0));
+ assertRows("SELECT max(v) FROM %s", row(1));
+ assertRows("SELECT writetime(v) FROM %s", row(10L), row(1L));
+ assertRows("SELECT min(writetime(v)) FROM %s", row(1L));
+ assertRows("SELECT max(writetime(v)) FROM %s", row(10L));
+ assertRows("SELECT min(maxwritetime(v)) FROM %s", row(1L));
+ assertRows("SELECT max(maxwritetime(v)) FROM %s", row(10L));
Review Comment:
oh.. I see.
maxwritetime(v) => [1, 10]
and max([1, 10]) => 10
and min([1, 10]) => 1
Confusing indeed, but nothing to do with this patch.
--
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]