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

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

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.12.0
    • Component/s: core
    • Labels:
      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

              • Assignee:
                julianhyde Julian Hyde
                Reporter:
                risdenk Kevin Risden
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: