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

Optimization that simplifies expressions such as '1 > a or 1 <= a or a is null' to TRUE is incorrect when it requires casts that are not lossless

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.38.0
    • 1.39.0
    • None

    Description

      Before this PR:

      // "OR(IS NULL(?0.a), <(1, CAST(?0.a):INTEGER), >=(1, CAST(?0.a):INTEGER))"
      // when (?0.a) is TINYINT
      // ==> "OR(IS NULL(?0.a), <(1, CAST(?0.a):INTEGER), >=(1, CAST(?0.a):INTEGER))" 

      After this PR:

      // "OR(IS NULL(?0.a), <(1, CAST(?0.a):INTEGER), >=(1, CAST(?0.a):INTEGER))"
      // when (?0.a) is TINYINT
      // ==> "TRUE"

      Attachments

        Issue Links

          Activity

            People

              nobigo xiong duan
              nobigo xiong duan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: