[
https://issues.apache.org/jira/browse/CALCITE-2783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16750300#comment-16750300
]
Julian Hyde commented on CALCITE-2783:
--------------------------------------
What is calcite-1.17.0-260-g217f2d082? That sounds like a release. But it's
not a release.
As [~vlsi] said in the github comments, "Fix null related issues during
RexToLix translation" is not a good description of this issue. First, issues
don't start with the word "fix". Second, if issues affect end-users, then you
should describe the issue as they would encounter it. If the issue can be
described in SQL, describe it in SQL, not in terms of obscure APIs. In this
case, "b OR b IS UNKNOWN returns incorrect results".
> Fix null related issues during RexToLix translation
> ---------------------------------------------------
>
> Key: CALCITE-2783
> URL: https://issues.apache.org/jira/browse/CALCITE-2783
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.18.0
> Environment: Using Apache Beam
> 1ad4affb450809842670df0434e12d953af31e166. (See BEAM-6401).
> Does not reproduce on Calcite 064974d543874e47a9da8ea0595824dde398bee1.
> Does reproduce on Calcite b470a0cd4572c9f6c4c0e9b51926b97c5af58d3f, 1.18, and
> master@62b47aeeb7eeb59beaf5b8f3b54a5c58ba4ca76d.
> (This is introduced by CALCITE-1413)
> Reporter: Andrew Pilloud
> Assignee: Zoltan Haindrich
> Priority: Major
> Fix For: 1.19.0
>
>
> This first appears in 1.18, and is introduced by CALCITE-1413.
> I have a table "table" with column "f0" of nullable booleans. Table contains
> the following values:
> {code:java}
> true
> false
> null
> {code}
> Working query:
> {code:java}
> SELECT coalesce(f0, true) FROM table;
> true
> false
> true
> {code}
> Broken query:
> {code:java}
> SELECT coalesce(f0, true) = true FROM table;
> Caused by: java.lang.NullPointerException
> at
> org.apache.calcite.runtime.SqlFunctions.cannotConvert(SqlFunctions.java:1457)
> at org.apache.calcite.runtime.SqlFunctions.toBoolean(SqlFunctions.java:1480)
> at SC.eval0(Unknown Source)
> {code}
> Broken generated code:
> {code:java}
> {
> final Boolean inp0_ = ((Row) c.element()).getBoolean(0);
> c.output(Row.withSchema(outputSchema).addValue((SqlFunctions.isTrue(inp0_)
> || inp0_ == null ? Boolean.TRUE : inp0_ == null ? (Boolean) null :
> Boolean.FALSE) == null ? (Boolean) null :
> Boolean.valueOf(SqlFunctions.toBoolean(inp0_) || inp0_ == null)).build());
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)