You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2017/05/09 15:48:04 UTC

[jira] [Comment Edited] (CALCITE-1770) Filters with Null fail with NPE

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

Jesus Camacho Rodriguez edited comment on CALCITE-1770 at 5/9/17 3:47 PM:
--------------------------------------------------------------------------

Nullability of functions is taken care of by Calcite type system: the type of the value returned by a function can be 'nullable' or 'not nullable', and the logic to fold expressions uses that information to remain correct.

Concerning the CAST, {{\"product_id\" = NULL}} seems to face the same issue (return records with empty product_id instead of no records).

Finally, for this specific issue issue, I agree that we needed to fix the NPE. However, as Druid does not support SQL null semantics, I think the correct way to handle this case would have been to bail out from pushing filters/expressions that contain NULL literals, just as we do for functions that handle null values such as IS NULL or IS NOT NULL. What do you think?


was (Author: jcamachorodriguez):
Nullability of functions is taken care of by Calcite type system: the type of the value returned by a function can be 'nullable' or 'not nullable', and the logic to fold expressions uses that information to remain correct.

Concerning the CAST, {{\"product_id\" = NULL}} seems to face the same issue (return records with empty product_id instead of no records).

Finally, for this specific issue issue, I agree that we needed to fix the NPE. However, as Druid does not support SQL null semantics, I think the correct way to handle this case would have been to bail out from pushing filters/expressions that contain NULL literals, just as we do for functions that handle null values such as IS NULL or IS NOT NULL.

> Filters with Null fail with NPE
> -------------------------------
>
>                 Key: CALCITE-1770
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1770
>             Project: Calcite
>          Issue Type: Bug
>          Components: druid
>            Reporter: slim bouguerra
>            Assignee: Julian Hyde
>             Fix For: 1.13.0
>
>
> Following query  fails with NPE
> {code} SELECT product_id from foodmart where product_id = NULL group by product_id {code} 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)