You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Evgeny Stanilovsky (Jira)" <ji...@apache.org> on 2023/04/14 10:17:00 UTC
[jira] [Assigned] (IGNITE-18167) SQL: incorrect NULLIF behavior
[ https://issues.apache.org/jira/browse/IGNITE-18167?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Evgeny Stanilovsky reassigned IGNITE-18167:
-------------------------------------------
Assignee: Evgeny Stanilovsky
> 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, calcite3-required, ignite-3
>
> 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)