Julian, I found some notes from SQL Standard - ISO/IEC 9075:2011 4.5.1:
"This specification does not make a distinction between the null value of the boolean data type and the truth value Unknown that is the result of an SQL <predicate>, <search condition>, or <boolean value expression>; they may be used interchangeably to mean exactly the same thing." When Postgres executes this query: SELECT (CASE WHEN true or not null then 1 else 0 end) from (VALUES(1)) foo; it returns correct result. So do I use old specification? And what SQL standard are you mentioned? Kind regards, Serhii Harnyk 2016-12-06 17:39 GMT+00:00 Julian Hyde <[email protected]>: > We (and the SQL standard) don't allow raw NULLs. I'm not convinced > that BOOLEAN should be treated differently from other types. The only > difference between BOOLEAN and other types is that BOOLEAN allows > UNKNOWN as a synonym for NULL; none of your examples use UNKNOWN. > > On Tue, Dec 6, 2016 at 8:18 AM, Serhii Harnyk <[email protected]> > wrote: > > Hello, > > > > I have created pull request to CALCITE-1531 > > <https://issues.apache.org/jira/browse/CALCITE-1531>: > > https://github.com/apache/calcite/pull/335. > > NULL in boolean operators in Calcite corresponds to Boolean type UNKNOWN, > > so when NULL is used in this operators, we shouldn't throw exception and > > continue query execution. > > > > Could anyone please review it? > > > > Kind regards, > > Serhii Harnyk >
