Yifan Cai created CASSANDRA-17681:
-------------------------------------
Summary: CQL function writetime should not be allowed to apply on
UDT columns
Key: CASSANDRA-17681
URL: https://issues.apache.org/jira/browse/CASSANDRA-17681
Project: Cassandra
Issue Type: Bug
Components: CQL/Semantics
Reporter: Yifan Cai
The CQL function writetime is disallowed to be applied to multi-cell columns,
since no meaningful writetime can be determined from the cells.
Inspecting the code (i.e. WritetimeOrTTL#newSelectorFactory), it only check
whether the column type is collection, ignoring the case of UDT. See the
example below.
It should be fixed.
{code:java}
[cqlsh 6.1.0 | Cassandra 4.2-SNAPSHOT | CQL spec 3.4.5 | Native protocol v5]
cqlsh> CREATE TYPE test.my_udt (a int, b int);
cqlsh> CREATE TABLE test.tbl_wt (k int primary key, t test.my_udt);
cqlsh> INSERT INTO test.tbl_wt (k, t) VALUES (1, { a: 1, b: 1 } );
cqlsh> SELECT writetime(t) FROM test.tbl_wt WHERE k = 1;
writetime(t)
--------------
-1
(1 rows)
{code}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]