You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Yury Gerzhedovich (Jira)" <ji...@apache.org> on 2023/05/03 08:34:00 UTC
[jira] [Updated] (IGNITE-18167) SQL: incorrect NULLIF behavior
[ https://issues.apache.org/jira/browse/IGNITE-18167?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yury Gerzhedovich updated IGNITE-18167:
---------------------------------------
Labels: calcite ignite-3 (was: calcite calcite3-required ignite-3)
> SQL: incorrect NULLIF behavior
> ------------------------------
>
> Key: IGNITE-18167
> URL: https://issues.apache.org/jira/browse/IGNITE-18167
> Project: Ignite
> Issue Type: Bug
> Components: sql
> Affects Versions: 3.0.0-beta1
> Reporter: Andrey Khitrin
> Assignee: Evgeny Stanilovsky
> Priority: Major
> Labels: calcite, ignite-3
> Time Spent: 20m
> Remaining Estimate: 0h
>
> A SQL spec says the following:
> ??NULLIF (V1 , V2) is equivalent to the following <case specification>: CASE WHEN V1 = V2 THEN NULL ELSE V1 END??
> When I try to run it, the rule above is true only for the simplest cases.
> {code:sql}
> select NULLIF(25, 25); --> null (OK)
> select NULLIF(24, 25); --> 24 (OK)
> select NULLIF('test', 'abc'); --> 'test' (OK)
> select NULLIF('test', 'test'); --> '' (should be null!)
> select NULLIF(24 + 1, 26 - 1); --> error IGN-SQL-27 (should be null!)
> {code}
> Probably, there are two defects: one is for wrong return value in case of textual data, and another one is for error when expression within NULLIF is used.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)