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

Simplify "1 = 1" to true, "1 > 2" to false

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.12.0
    • core
    • None

    Description

      The RexUtil.simplify method should handle literal comparison simplification. From an email on the calcite-dev mailing list:

      Calcite doesn't seem to optimize away the literal comparison literal case
      with RexUtil.simplify. In my understanding any literal comparison literal
      results in a simple TRUE/FALSE result.

      I'm not sure this is valid in the general case, but I put together a simple
      example of doing this on the RexUtil simplifyCall.

      https://github.com/apache/calcite/pull/376

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              krisden Kevin Risden
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: