[jira] [Commented] (CASSANDRA-17762) LWT IF col = NULL is inconsistent with SQL NULL
[ https://issues.apache.org/jira/browse/CASSANDRA-17762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17607367#comment-17607367 ] Ekaterina Dimitrova commented on CASSANDRA-17762: - I'll be looking into this one soon. Reading here, it seems more or less there is some consensus but I guess I still need to send mail to the ML at least for awareness? To summarize: _Utilizing {{IS NULL}} and {{IS NOT NULL in LWT}} (in practice we need to do it everywhere including for column filtering (CASSANDRA-10715))._ _Even without looking at SQL we are also not consistent within CQL where we use x {{= null}} and x != null for LWT but {{IS NOT NULL}} for Materialized views._ _On one side to be consistent in CQL, on another consistent with SQL._ _It should also be easy to support both syntaxes ({{{}x = null{}}}/{{{}X IS NULL{}}}) while warning the user that the first syntax is deprecated until the next major release._ I guess the question is [~avi.kivity]'s point around NULL being valid in SQL. Shall we deal with the change of meaning for X = NULL as part of this ticket or just deprecate for now X = NULL and spin that part into another ticket? And still bring that to the mailing list... There were a few discussions in parallel around CQL syntax lately so I hope I didn't miss any point here. > LWT IF col = NULL is inconsistent with SQL NULL > --- > > Key: CASSANDRA-17762 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17762 > Project: Cassandra > Issue Type: Bug > Components: CQL/Semantics >Reporter: Avi Kivity >Assignee: Ekaterina Dimitrova >Priority: Normal > Fix For: 4.x > > > In SQL, any comparison with NULL is NULL, which is interpreted as FALSE in a > condition. To test for NULLness, you use IS NULL or IS NOT NULL. > But LWT uses IF col = NULL as a NULLness test. This is likely to confuse > people coming from SQL and hamper attempts to extend the dialect. -- 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
[jira] [Commented] (CASSANDRA-17762) LWT IF col = NULL is inconsistent with SQL NULL
[ https://issues.apache.org/jira/browse/CASSANDRA-17762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17583746#comment-17583746 ] Avi Kivity commented on CASSANDRA-17762: One problem is that X = NULL is valid SQL, it just has a different meaning than CQL. (it means UNKNOWN or NULL). So the syntax can't be deprecated, just the interpretation. So I think it makes sense to have a config item indicate which interpretation to use, so applications can be migrated independently of the update schedule (and problems with mixed version clusters avoided). > LWT IF col = NULL is inconsistent with SQL NULL > --- > > Key: CASSANDRA-17762 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17762 > Project: Cassandra > Issue Type: Bug > Components: CQL/Semantics >Reporter: Avi Kivity >Priority: Normal > Fix For: 4.x > > > In SQL, any comparison with NULL is NULL, which is interpreted as FALSE in a > condition. To test for NULLness, you use IS NULL or IS NOT NULL. > But LWT uses IF col = NULL as a NULLness test. This is likely to confuse > people coming from SQL and hamper attempts to extend the dialect. -- 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
[jira] [Commented] (CASSANDRA-17762) LWT IF col = NULL is inconsistent with SQL NULL
[ https://issues.apache.org/jira/browse/CASSANDRA-17762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17583711#comment-17583711 ] Benjamin Lerer commented on CASSANDRA-17762: {quote}I'd be in favor of keeping the new syntax in line w/ SQL\{quote} Even without looking at SQL we are also not consistent within CQL where we use x {{= null}} and x != null for LWT but {{IS NOT NULL}} for Materialized views. Utilizing {{IS NULL}} and {{IS NOT NULL}} everywhere including for column filtering (CASSANDRA-10715) make total sense in my opinion. It should also be easy to support both syntaxes (\{{x = null}}/\{{X IS NULL}}) while warning the user that the first syntax is deprecated until the next major release. > LWT IF col = NULL is inconsistent with SQL NULL > --- > > Key: CASSANDRA-17762 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17762 > Project: Cassandra > Issue Type: Bug > Components: CQL/Semantics >Reporter: Avi Kivity >Priority: Normal > Fix For: 4.x > > > In SQL, any comparison with NULL is NULL, which is interpreted as FALSE in a > condition. To test for NULLness, you use IS NULL or IS NOT NULL. > But LWT uses IF col = NULL as a NULLness test. This is likely to confuse > people coming from SQL and hamper attempts to extend the dialect. -- 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
[jira] [Commented] (CASSANDRA-17762) LWT IF col = NULL is inconsistent with SQL NULL
[ https://issues.apache.org/jira/browse/CASSANDRA-17762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17570456#comment-17570456 ] Avi Kivity commented on CASSANDRA-17762: I tested 4.0.4 with NULL provided via a bind variable, and it rejects the query. > LWT IF col = NULL is inconsistent with SQL NULL > --- > > Key: CASSANDRA-17762 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17762 > Project: Cassandra > Issue Type: Bug > Components: CQL/Semantics >Reporter: Avi Kivity >Priority: Normal > Fix For: 4.x > > > In SQL, any comparison with NULL is NULL, which is interpreted as FALSE in a > condition. To test for NULLness, you use IS NULL or IS NOT NULL. > But LWT uses IF col = NULL as a NULLness test. This is likely to confuse > people coming from SQL and hamper attempts to extend the dialect. -- 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
[jira] [Commented] (CASSANDRA-17762) LWT IF col = NULL is inconsistent with SQL NULL
[ https://issues.apache.org/jira/browse/CASSANDRA-17762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17569185#comment-17569185 ] Benedict Elliott Smith commented on CASSANDRA-17762: It's still a change of semantic, and an inconsistency in our behaviour, even if it only affects the new transaction syntax. I don't think it needs a lengthy discussion, just a summary of what we have agreed so far (if we have indeed agreed anything yet) and an invitation for comment or to join the discussion here. > LWT IF col = NULL is inconsistent with SQL NULL > --- > > Key: CASSANDRA-17762 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17762 > Project: Cassandra > Issue Type: Bug > Components: CQL/Semantics >Reporter: Avi Kivity >Priority: Normal > Fix For: 4.x > > > In SQL, any comparison with NULL is NULL, which is interpreted as FALSE in a > condition. To test for NULLness, you use IS NULL or IS NOT NULL. > But LWT uses IF col = NULL as a NULLness test. This is likely to confuse > people coming from SQL and hamper attempts to extend the dialect. -- 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
[jira] [Commented] (CASSANDRA-17762) LWT IF col = NULL is inconsistent with SQL NULL
[ https://issues.apache.org/jira/browse/CASSANDRA-17762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17569173#comment-17569173 ] Caleb Rackliffe commented on CASSANDRA-17762: - Agree for existing LWT for sure, but I meant more for CASSANDRA-17719. > LWT IF col = NULL is inconsistent with SQL NULL > --- > > Key: CASSANDRA-17762 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17762 > Project: Cassandra > Issue Type: Bug > Components: CQL/Semantics >Reporter: Avi Kivity >Priority: Normal > Fix For: 4.x > > > In SQL, any comparison with NULL is NULL, which is interpreted as FALSE in a > condition. To test for NULLness, you use IS NULL or IS NOT NULL. > But LWT uses IF col = NULL as a NULLness test. This is likely to confuse > people coming from SQL and hamper attempts to extend the dialect. -- 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
[jira] [Commented] (CASSANDRA-17762) LWT IF col = NULL is inconsistent with SQL NULL
[ https://issues.apache.org/jira/browse/CASSANDRA-17762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17569171#comment-17569171 ] Benedict Elliott Smith commented on CASSANDRA-17762: bq. This doesn't seem ML-worthy I think stuff that changes the semantics of CQL do need to be run past the mailing list, even if it's just to make sure there's visibility for others to express their opinions. > LWT IF col = NULL is inconsistent with SQL NULL > --- > > Key: CASSANDRA-17762 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17762 > Project: Cassandra > Issue Type: Bug > Components: CQL/Semantics >Reporter: Avi Kivity >Priority: Normal > Fix For: 4.x > > > In SQL, any comparison with NULL is NULL, which is interpreted as FALSE in a > condition. To test for NULLness, you use IS NULL or IS NOT NULL. > But LWT uses IF col = NULL as a NULLness test. This is likely to confuse > people coming from SQL and hamper attempts to extend the dialect. -- 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
[jira] [Commented] (CASSANDRA-17762) LWT IF col = NULL is inconsistent with SQL NULL
[ https://issues.apache.org/jira/browse/CASSANDRA-17762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17569169#comment-17569169 ] Benedict Elliott Smith commented on CASSANDRA-17762: bq. Although there's a good chance it will fail with a NULL supplied via a bind variable. This would make me sad, but unsurprised. > LWT IF col = NULL is inconsistent with SQL NULL > --- > > Key: CASSANDRA-17762 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17762 > Project: Cassandra > Issue Type: Bug > Components: CQL/Semantics >Reporter: Avi Kivity >Priority: Normal > Fix For: 4.x > > > In SQL, any comparison with NULL is NULL, which is interpreted as FALSE in a > condition. To test for NULLness, you use IS NULL or IS NOT NULL. > But LWT uses IF col = NULL as a NULLness test. This is likely to confuse > people coming from SQL and hamper attempts to extend the dialect. -- 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
[jira] [Commented] (CASSANDRA-17762) LWT IF col = NULL is inconsistent with SQL NULL
[ https://issues.apache.org/jira/browse/CASSANDRA-17762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17569133#comment-17569133 ] Caleb Rackliffe commented on CASSANDRA-17762: - I'm going to start driving CASSANDRA-17719 a little harder soon. In any case, I'd be in favor of keeping the new syntax in line w/ SQL. This doesn't seem ML-worthy, unless we're worried about the broader WHERE case, and it seems like we're not? > LWT IF col = NULL is inconsistent with SQL NULL > --- > > Key: CASSANDRA-17762 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17762 > Project: Cassandra > Issue Type: Bug > Components: CQL/Semantics >Reporter: Avi Kivity >Priority: Normal > Fix For: 4.x > > > In SQL, any comparison with NULL is NULL, which is interpreted as FALSE in a > condition. To test for NULLness, you use IS NULL or IS NOT NULL. > But LWT uses IF col = NULL as a NULLness test. This is likely to confuse > people coming from SQL and hamper attempts to extend the dialect. -- 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
[jira] [Commented] (CASSANDRA-17762) LWT IF col = NULL is inconsistent with SQL NULL
[ https://issues.apache.org/jira/browse/CASSANDRA-17762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17569121#comment-17569121 ] Avi Kivity commented on CASSANDRA-17762: {{WHERE}} is protected by a grammar limitation: {noformat} cassandra@cqlsh> select * from system.local where key = null ALLOW FILTERING; InvalidRequest: Error from server: code=2200 [Invalid query] message="Invalid null value in condition for column key" cassandra@cqlsh> select * from system.local where data_center = null ALLOW FILTERING; InvalidRequest: Error from server: code=2200 [Invalid query] message="Unsupported null value for column data_center"{noformat} Although there's a good chance it will fail with a NULL supplied via a bind variable. > LWT IF col = NULL is inconsistent with SQL NULL > --- > > Key: CASSANDRA-17762 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17762 > Project: Cassandra > Issue Type: Bug > Components: CQL/Semantics >Reporter: Avi Kivity >Priority: Normal > Fix For: 4.x > > > In SQL, any comparison with NULL is NULL, which is interpreted as FALSE in a > condition. To test for NULLness, you use IS NULL or IS NOT NULL. > But LWT uses IF col = NULL as a NULLness test. This is likely to confuse > people coming from SQL and hamper attempts to extend the dialect. -- 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
[jira] [Commented] (CASSANDRA-17762) LWT IF col = NULL is inconsistent with SQL NULL
[ https://issues.apache.org/jira/browse/CASSANDRA-17762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17569105#comment-17569105 ] Benedict Elliott Smith commented on CASSANDRA-17762: I agree this is an issue, but not sure how best to resolve it. Since we're introducing new transaction syntax that will eventually likely deprecate this syntax, it might be easier to leave this as-is and resolve it in the new syntax [~bdeggleston] is cooking up? > LWT IF col = NULL is inconsistent with SQL NULL > --- > > Key: CASSANDRA-17762 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17762 > Project: Cassandra > Issue Type: Bug > Components: CQL/Semantics >Reporter: Avi Kivity >Priority: Normal > Fix For: 4.x > > > In SQL, any comparison with NULL is NULL, which is interpreted as FALSE in a > condition. To test for NULLness, you use IS NULL or IS NOT NULL. > But LWT uses IF col = NULL as a NULLness test. This is likely to confuse > people coming from SQL and hamper attempts to extend the dialect. -- 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
[jira] [Commented] (CASSANDRA-17762) LWT IF col = NULL is inconsistent with SQL NULL
[ https://issues.apache.org/jira/browse/CASSANDRA-17762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17569012#comment-17569012 ] Brandon Williams commented on CASSANDRA-17762: -- This is probably something that should seek consensus on the ML. > LWT IF col = NULL is inconsistent with SQL NULL > --- > > Key: CASSANDRA-17762 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17762 > Project: Cassandra > Issue Type: Bug > Components: CQL/Semantics >Reporter: Avi Kivity >Priority: Normal > Fix For: 4.x > > > In SQL, any comparison with NULL is NULL, which is interpreted as FALSE in a > condition. To test for NULLness, you use IS NULL or IS NOT NULL. > But LWT uses IF col = NULL as a NULLness test. This is likely to confuse > people coming from SQL and hamper attempts to extend the dialect. -- 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
[jira] [Commented] (CASSANDRA-17762) LWT IF col = NULL is inconsistent with SQL NULL
[ https://issues.apache.org/jira/browse/CASSANDRA-17762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17568993#comment-17568993 ] Avi Kivity commented on CASSANDRA-17762: A possible solution is to add a configuration variable specifying how to handle = NULL: legacy, legacy+warn, sql+warn, sql. Eventually the legacy interpretation should be deprecated. > LWT IF col = NULL is inconsistent with SQL NULL > --- > > Key: CASSANDRA-17762 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17762 > Project: Cassandra > Issue Type: Bug > Components: CQL/Semantics >Reporter: Avi Kivity >Priority: Normal > > In SQL, any comparison with NULL is NULL, which is interpreted as FALSE in a > condition. To test for NULLness, you use IS NULL or IS NOT NULL. > But LWT uses IF col = NULL as a NULLness test. This is likely to confuse > people coming from SQL and hamper attempts to extend the dialect. -- 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