You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2018/08/17 21:41:00 UTC
[jira] [Commented] (CALCITE-2472) {fn IFNULL(value1, value2)}
doesn't work when value1 and value2 are different types
[ https://issues.apache.org/jira/browse/CALCITE-2472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16584410#comment-16584410 ]
Julian Hyde commented on CALCITE-2472:
--------------------------------------
I can well believe this is an issue. I don't know what the spec for IFNULL says, but I assume it's similar to CASE: require arguments to be in the same family, deduce a lowest-common-demoninator type, and insert implicit casts.
> {fn IFNULL(value1, value2)} doesn't work when value1 and value2 are different types
> -----------------------------------------------------------------------------------
>
> Key: CALCITE-2472
> URL: https://issues.apache.org/jira/browse/CALCITE-2472
> Project: Calcite
> Issue Type: Bug
> Reporter: Zhaotong Guo
> Assignee: Julian Hyde
> Priority: Major
>
> {quote}
> {code:java}
> select {fn IFNULL(value1, value2)} from table1 where id = 3{code}
> {quote}
> When value1 and value2 are the same types, it works.
> When value1 can be cast to value2, for example, value1 is an int and value2 is a double, both of them are not null. It will return value1 which is cast to double.
> When value1 and value2 are different types, it doesn't work.
> I use Calcite 1.17.0.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)