Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6776

Multiple expanded `IS NOT DISTINCT FROM` cannot be collapsed back

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.39.0
    • None

    Description

      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:

      left.A IS NOT DISTINCT FROM right.A AND 
      left.B IS NOT DISTINCT FROM right.B

      will become:

      (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)) 

       

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

      Attachments

        Issue Links

          Activity

            People

              linorosa Lino Rosa
              linorosa Lino Rosa
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: