Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
3.0.28, 3.11.14, 4.0.5, 4.1-alpha1, 4.1, 5.0-alpha1, 5.0
-
None
-
Correctness - API / Semantic Definition
-
Normal
-
Low Hanging Fruit
-
Adhoc Test
-
All
-
None
-
Description
CQL writetime and ttl functions are currently forbidden for collections, frozen or not. Also, they are always allowed for UDTs, frozen or not:
CREATE TYPE udt (a int, b int); CREATE TABLE t (k int PRIMARY KEY, s set<int>, fs frozen<set<int>>, t udt, ft frozen<udt>); SELECT writetime(s) FROM t; -- fails SELECT writetime(st) FROM t; -- fails SELECT writetime(t) FROM t; -- allowed SELECT writetime(ft) FROM t; -- allowed
This is done by checking in Selectable.WritetimeOrTTL#newSelectorFactory whether the column is a collection or not. However, I think that what we should check is whether the column is multi-cell. That way the function would work with frozen collections and UDTs, and it would reject unfrozen collections and UDTs:
SELECT writetime(s) FROM t; -- fails SELECT writetime(st) FROM t; -- allowed SELECT writetime(t) FROM t; -- fails SELECT writetime(ft) FROM t; -- allowed
Attachments
Issue Links
- Blocked
-
CASSANDRA-17681 CQL function writetime should not be allowed to apply on UDT columns
- Resolved
- Discovered while testing
-
CASSANDRA-17425 Add new CQL function maxWritetime
- Resolved
- is related to
-
CASSANDRA-8877 Ability to read the TTL and WRITE TIME of an element in a collection
- Resolved