You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2013/09/10 15:11:51 UTC

[jira] [Updated] (CASSANDRA-5910) Most CQL3 functions should handle null gracefully

     [ https://issues.apache.org/jira/browse/CASSANDRA-5910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne updated CASSANDRA-5910:
----------------------------------------

    Attachment: 5910-v2.txt

Sounds good to me. Attaching v2 that just makes all existing function handle null correctly (token() will return null as soon as any one of its argument is null). We can see later for what we do when returning null doesn't fly anymore.
                
> Most CQL3 functions should handle null gracefully
> -------------------------------------------------
>
>                 Key: CASSANDRA-5910
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5910
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 1.2.10
>
>         Attachments: 5910.txt, 5910-v2.txt
>
>
> Currently, we don't allow null parameters for functions. So
> {noformat}
> UPDATE test SET d=dateOf(null) WHERE k=0
> {noformat}
> is basically an invalid query. Unfortunately, there's at least one case where we don't validate correctly, namely if we do:
> {noformat}
> SELECT k, dateOf(t) FROM test
> {noformat}
> In that case, if for any of the row {{t}} is null, we end up with a server side NPE. But more importantly, throwing an InvalidException in that case would be pretty inconvenient and actually somewhat wrong since the query is not invalid in itself. So, at least in that latter case, we want {{dateOf(t) == null}} when {{t == null}}. And if we do that, I suggest making it always the case (i.e. make the first query valid but assigning {{null}} to {{d}}).

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