[ https://issues.apache.org/jira/browse/CALCITE-3128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16872709#comment-16872709 ]
Julian Hyde commented on CALCITE-3128: -------------------------------------- Current behavior is wrong. Cartesian product of one row to one row should produce one row, regardless of whether columns are null. MySQL and PostgreSQL are correct. I think it's very plausible that the problem is in Linq4j. Linq4j tries to be clever and represents 1-column collections as raw values. Which is fine. But if "null" also means "was empty" there's a problem. Probably the fix should include a test for Linq4j hashJoin_ in addition to a SQL-level test. > Joining two tables producing only NULLs will return 0 rows > ---------------------------------------------------------- > > Key: CALCITE-3128 > URL: https://issues.apache.org/jira/browse/CALCITE-3128 > Project: Calcite > Issue Type: Bug > Components: core > Affects Versions: 1.20.0 > Reporter: Muhammad Gelbana > Priority: Major > > The following queries will return 0 rows while they're expected to ruturn > rows with NULLs in them. > {code:sql} > SELECT * > FROM (SELECT NULLIF(5, 5)) a, (SELECT NULLIF(5, 5)) b > {code} > {code:sql} > SELECT * > FROM (VALUES (NULLIF(5, 5)), (NULLIF(5, 5))) a, (VALUES (NULLIF(5, 5)), > (NULLIF(5, 5))) b > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)