You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Lino Rosa (Jira)" <ji...@apache.org> on 2025/01/09 14:20:00 UTC

[jira] [Created] (CALCITE-6776) Multiple expanded `IS NOT DISTINCT FROM` cannot be collapsed back

Lino Rosa created CALCITE-6776:
----------------------------------

             Summary: Multiple expanded `IS NOT DISTINCT FROM` cannot be collapsed back
                 Key: CALCITE-6776
                 URL: https://issues.apache.org/jira/browse/CALCITE-6776
             Project: Calcite
          Issue Type: Bug
            Reporter: Lino Rosa
            Assignee: Lino Rosa


When a query has multiple `IS NOT DISTINCT FROM` operations, the resulting query won't collapse them back and keeps them in expanded form. 

For example:
{code:java}
left.A IS NOT DISTINCT FROM right.A AND 
left.B IS NOT DISTINCT FROM right.B{code}
will become:
{code:java}
(left.A IS NULL AND right.A IS NULL) OR (left.A = right.A)) AND
(left.B IS NULL AND right.B IS NULL) OR (left.B = right.B)) {code}
 

This is particularly a problem with Spark, where the presence of the {{OR}} will result in a {{BroadcastLoopJoin}} and derail the query execution.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)