cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-6055) 'Bad Request: Invalid null value for partition key part' on SELECT .. WHERE key IN (val,NULL)
Date Thu, 19 Sep 2013 09:54:53 GMT

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

Sylvain Lebresne commented on CASSANDRA-6055:
---------------------------------------------

Well, let me just quickly say that CQL is *nowhere* near close to SQL compatibility: it doesn't
support joins, sub-queries, aggregations, transactions, etc. And there is strong reason why
those will never be supported, not in their full SQL generality at least. So it's not like
tools that generate SQL are likely to work with CQL in general anyway. So we won't do any
change to CQL if we think it doesn't make sense to CQL *only* because it works in SQL.


But that being said, I did somewhat misunderstood the issue raised and I apologize for that.
If the goal is to support nulls as much as possible in the where clause of selects, then I
guess that's something that can make sense for CQL. But while supporting it for PK columns
is trivial (they can't be null, so we can just consider the clause as unsatisfiable, which
is what SQL does), doing it for non-PK columns is quite a bit harder. Typically I don't see
anyway to make null work for indexed columns. The only case where I think we could make it
work is when ALLOW FILTERING is used but I'm not sure that's very useful. As for supporting
it for PK columns (that cannot be null) if we don't support it for non-PK ones (that can be
null), I'm -0 on the idea as I think it'll be more confusing/frustrating than anything else.

Reopening nonetheless. If someone has a brilliant idea to support null value for indexed columns,
that could be useful...
                
> 'Bad Request: Invalid null value for partition key part' on SELECT .. WHERE key IN (val,NULL)
> ---------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-6055
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6055
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: cqlsh, pdo_cassandra
>            Reporter: Sergey Nagaytsev
>            Priority: Minor
>              Labels: cql3
>
> Query: SELECT * FROM user WHERE key IN(uuid,NULL);
> Table:
> CREATE COLUMNFAMILY user (
>      KEY uuid PRIMARY KEY,
>      name text,
>      note text,
>      avatar text,
>      email text,
>      phone text,
>      login text,
>      pw text,
>      st text
> );
> Logs: Nothing, last message hours ago.
> This query is good in SQL and so is generated by DB abstraction library. Fix on applications
sides is multiplying of work.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message