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

      = is reflexive and we can simplify it to true if the operands are equal

        Issue Links

          Activity

          Hide
          julianhyde Julian Hyde added a comment -

          Resolved in release 1.12.0 (2017-03-24).

          Show
          julianhyde Julian Hyde added a comment - Resolved in release 1.12.0 (2017-03-24).
          Hide
          julianhyde Julian Hyde added a comment -

          Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/34997ad1.

          The change also simplifies "x < x", "x <= x", "x > x", "x >= x", "x != x".

          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/34997ad1 . The change also simplifies "x < x", "x <= x", "x > x", "x >= x", "x != x".
          Hide
          julianhyde Julian Hyde added a comment -

          Correction: The correct rewrite is "$x = $x" → "case when $x is not null then true else unknown end". But in most cases unknown and false have the same effect.

          By the way. I don't have a firm ETA when that commit will be pushed to master. If you want to extract just the parts related to the "$x = $x" rewrite (including the tests I added) and commit separately, be my guest.

          Show
          julianhyde Julian Hyde added a comment - Correction: The correct rewrite is "$x = $x" → "case when $x is not null then true else unknown end". But in most cases unknown and false have the same effect. By the way. I don't have a firm ETA when that commit will be pushed to master. If you want to extract just the parts related to the "$x = $x" rewrite (including the tests I added) and commit separately, be my guest.
          Hide
          julianhyde Julian Hyde added a comment -

          As it happens I've already done this, as part of https://github.com/julianhyde/calcite/commit/c8e266521328a115e2075aea335ae655c099f8a8. The correct rewrite IMHO is "$x = $x" → "$x is not null". (And the latter will get simplified to true if x is not null.) I'll commit it as part of the fix for CALCITE-1494.

          Show
          julianhyde Julian Hyde added a comment - As it happens I've already done this, as part of https://github.com/julianhyde/calcite/commit/c8e266521328a115e2075aea335ae655c099f8a8 . The correct rewrite IMHO is "$x = $x" → "$x is not null". (And the latter will get simplified to true if x is not null.) I'll commit it as part of the fix for CALCITE-1494 .

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              jbalint@gmail.com Jess Balint
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development