You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Josh McKenzie (Jira)" <ji...@apache.org> on 2022/07/06 15:52:00 UTC

[jira] [Commented] (CASSANDRA-17628) CQL writetime and ttl functions should be forbidden for multicell columns

    [ https://issues.apache.org/jira/browse/CASSANDRA-17628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17563311#comment-17563311 ] 

Josh McKenzie commented on CASSANDRA-17628:
-------------------------------------------

[CI Results]
Branch: 4.1, build number: 78
   butler url: https://butler.cassandra.apache.org/#/ci/upstream/compare/Cassandra-4.1/Cassandra-4.1
   jenkins url: https://ci-cassandra.apache.org/job/Cassandra-4.1/78/
   JIRA: CASSANDRA-17628
   commit url: https://gitbox.apache.org/repos/asf?p=cassandra.git;a=commit;h=09692d5a58d96089c699f59e9b7daacd066e902d
   affected paths:
* CHANGES.txt
* doc/cql3/CQL.textile
* src/java/org/apache/cassandra/cql3/selection/Selectable.java
* test/unit/org/apache/cassandra/cql3/validation/entities/WritetimeOrTTLTest.java

   Build Result: UNSTABLE
   Passing Tests: 47482
   Failing Tests: 10

||Test|Failures|JIRA||
|org.apache.cassandra.db.compaction.SingleSSTableLCSTaskTest.uplevelDisabledTest|3 of 75|[No JIRA found|https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=496&quickFilter=2252]
|dtest-upgrade.upgrade_tests.upgrade_through_versions_test.TestProtoV4Upgrade_AllVersions_EndsAt_Trunk_HEAD.test_parallel_upgrade|3 of 75|[CASSANDRA-17296?|https://issues.apache.org/jira/browse/CASSANDRA-17296]|
|org.apache.cassandra.cql3.validation.entities.SecondaryIndexTest.testWriteOnlyIndex|6 of 75|[No JIRA found|https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=496&quickFilter=2252]
|org.apache.cassandra.cql3.ViewComplexTTLTest.testUpdateColumnInViewPKWithTTLWithFlush[3]|14 of 75|[No JIRA found|https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=496&quickFilter=2252]
|org.apache.cassandra.distributed.upgrade.MixedModeFrom3UnloggedBatchTest.testSimpleStrategy|5 of 75|[No JIRA found|https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=496&quickFilter=2252]
|org.apache.cassandra.distributed.test.CASTest.testConflictingWritesWithStaleRingInformation|18 of 75|[CASSANDRA-17461?|https://issues.apache.org/jira/browse/CASSANDRA-17461]|
|dtest-upgrade.upgrade_tests.upgrade_through_versions_test.TestUpgrade_current_3_0_x_To_indev_4_1_x.test_bootstrap_multidc|2 of 75|[Multiple JIRAs found|https://issues.apache.org/jira/issues/?jql=project%20%3D%20CASSANDRA%20and%20resolution%20%3D%20unresolved%20and%20summary%20~%20"*TestUpgrade*"]
|org.apache.cassandra.cql3.validation.entities.SecondaryIndexTest.testIndexOnCountersInvalid|3 of 75|[No JIRA found|https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=496&quickFilter=2252]
|org.apache.cassandra.cql3.validation.operations.SelectTest.filteringWithOrderClause|5 of 75|[No JIRA found|https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=496&quickFilter=2252]
|org.apache.cassandra.cql3.validation.entities.SecondaryIndexTest.testCanQuerySecondaryIndex|6 of 75|[No JIRA found|https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=496&quickFilter=2252]


> CQL writetime and ttl functions should be forbidden for multicell columns
> -------------------------------------------------------------------------
>
>                 Key: CASSANDRA-17628
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17628
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL/Semantics
>            Reporter: Andres de la Peña
>            Assignee: Andres de la Peña
>            Priority: Normal
>             Fix For: 3.0.28, 3.11.14, 4.0.5, 4.1-alpha, 4.2
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> CQL {{writetime}} and {{ttl}} functions are currently forbidden for collections, frozen or not. Also, they are always allowed for UDTs, frozen or not:
> {code}
> 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
> {code}
> This is done by checking in [{{Selectable.WritetimeOrTTL#newSelectorFactory}}|https://github.com/apache/cassandra/blob/cassandra-4.0.4/src/java/org/apache/cassandra/cql3/selection/Selectable.java#L250] 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:
> {code}
> SELECT writetime(s) FROM t; -- fails
> SELECT writetime(st) FROM t; -- allowed
> SELECT writetime(t) FROM t; -- fails
> SELECT writetime(ft) FROM t; -- allowed
> {code} 



--
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