You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/04/23 19:27:44 UTC

[GitHub] [druid] suneet-s opened a new issue #9758: Druid SQL does not support IN clause with null

suneet-s opened a new issue #9758:
URL: https://github.com/apache/druid/issues/9758


   ### Affected Version
   
   Tested on 0.16, 0.17, 0.18
   
   ### Description
   
   The following SQL fails to plan with an ISE
   ```
   SELECT "channel", "cityName", "comment", "count", "countryIsoCode"
   FROM "wikipedia"
   WHERE
   countryIsoCode in ('TN', NULL)
   ```
   
   The error is in the broker where it is trying to plan the query (stacktrace too long to include here)
   Druid In filters support null values, so this should work.
   
   NOTE: when postgres issues a similar query it does not match rows where the column value is null - Druid would probably need to do something similar as well.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson commented on issue #9758: Druid SQL does not support IN clause with null

Posted by GitBox <gi...@apache.org>.
jihoonson commented on issue #9758:
URL: https://github.com/apache/druid/issues/9758#issuecomment-618621099


   Ideally, this query should be rewritten properly depending on null handling mode. With sql-compatible null handling, the where clause should be rewritten to `countryIsoCode = 'TN'`. With non-sql-compatible mode, it should be `countryIsoCode in ('TN', '')`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson commented on issue #9758: Druid SQL does not support IN clause with null

Posted by GitBox <gi...@apache.org>.
jihoonson commented on issue #9758:
URL: https://github.com/apache/druid/issues/9758#issuecomment-619148740


   In non-sql-compatible mode which is the default mode of Druid, nulls are replaced with a preconfigured default value which is an empty string by default. I think the filter in your comment would behave differently as well depending on the null handling mode.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] suneet-s commented on issue #9758: Druid SQL does not support IN clause with null

Posted by GitBox <gi...@apache.org>.
suneet-s commented on issue #9758:
URL: https://github.com/apache/druid/issues/9758#issuecomment-618785850


   @jihoonson How do we decide what the behavior of non-sql-compatible should be? I initially thought in non-sql-compatible mode, the query should map to a native query with this filter
   ```
   "filter": {
       "type": "in",
       "dimension": "countryIsoCode",
       "values": [
         null,
         "TN"
       ],
       "extractionFn": null
     },
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org