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

Benjamin Lerer edited comment on CASSANDRA-19637 at 6/11/24 4:39 PM:
---------------------------------------------------------------------

|| patch || CI ||
| [4.0|https://github.com/apache/cassandra/pull/3359] | 
[J11|https://app.circleci.com/pipelines/github/blerer/cassandra/417/workflows/a39123fa-7636-4362-9220-06df6f67225e]|
| [4.1|https://github.com/apache/cassandra/pull/3360] | 
[J11|https://app.circleci.com/pipelines/github/blerer/cassandra/423/workflows/fec4c970-444f-4e07-8c83-49940e256874]|
| [5.0|https://github.com/apache/cassandra/pull/3361] | 
[J11|https://app.circleci.com/pipelines/github/blerer/cassandra/424/workflows/a642d572-2a48-493e-8915-96be4c5f7b3e]|
| [trunk|https://github.com/apache/cassandra/pull/3366] | 
[J11|https://app.circleci.com/pipelines/github/blerer/cassandra/425/workflows/5e938414-9d25-4ae5-97e8-952a53f3c561]|


was (Author: blerer):
|| patch || CI ||
| [4.0|https://github.com/apache/cassandra/pull/3359] | 
[J11|https://app.circleci.com/pipelines/github/blerer/cassandra/417/workflows/a39123fa-7636-4362-9220-06df6f67225e]|
| [4.1|https://github.com/apache/cassandra/pull/3360] | 
[J11|https://app.circleci.com/pipelines/github/blerer/cassandra/423/workflows/fec4c970-444f-4e07-8c83-49940e256874]|
| [5.0|https://github.com/apache/cassandra/pull/3361] | 
[J11|https://app.circleci.com/pipelines/github/blerer/cassandra/424/workflows/a642d572-2a48-493e-8915-96be4c5f7b3e]|
| [trunk|https://github.com/apache/cassandra/pull/3362] | 
[J11|https://app.circleci.com/pipelines/github/blerer/cassandra/425/workflows/5e938414-9d25-4ae5-97e8-952a53f3c561]|

> LWT conditions behavior on collections is inconsistent
> ------------------------------------------------------
>
>                 Key: CASSANDRA-19637
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19637
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL/Semantics
>            Reporter: Benjamin Lerer
>            Assignee: Benjamin Lerer
>            Priority: Normal
>             Fix For: 4.0.x, 4.1.x, 5.0.x, 5.x
>
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> LWT conditions behaviour on collections is inconsistent in several ways 
> around null values:
> 1)+Conditions comparing a collection column with a {{null}} value to a 
> non-null have a different behaviour for frozen and non-frozen collection+.
>  {code}UPDATE myTable SET l = ? WHERE k = 0 IF l < [1, 2]{code}
> If {{l}} is null the previous query will return {{[false, null]}} for a 
> frozen collection and {{[true]}} for a non-frozen collection. 
> 2) +Conditions on non-frozen collection treat empty differently from null+
> Due to the way multi-cell collections are implemented, it is not possible to 
> differentiate between {{null}} and empty collections like it is feasible for 
> single cell (frozen) collections. Therefore an empty multi-cell collection 
> will always be treated as {{null}}.
> Unfortunately, the way LWT conditions handle that is not consistent with that.
> For example for {{colA list<int>}} non null: {code}.. IF colA >= null{code} 
> will throw an invalid request error whereas {code}..IF colA >= []{code} will 
> returns {{true}}.
> Moreover, if we insert an empty list through:
> {code}INSERT INTO mytable (pk, colA) VALUES (1, []);{code}
> and use {code}DELETE FROM mytable WHERE pk=1 IF colA = []{code} the returned 
> results will be {code}{false, null}{code}. Which can be quite confusing.
> The way to fix that behaviour to make it consistent with other operations is 
> to consider empty multi-cell collection input as {{null}} and reject the 
> {{null}} input for non {{=}} and {{!=}} operators.    
>   



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to