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

Add hashCode and equals implementations to RexNode

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.18.0
    • Component/s: None
    • Labels:
      None

      Description

      Right now RexNode doesn't have any equals or hashCode functions; which makes it rely on the default implementation.

      But when we are writing simplification logics we sometimes forget to use toString() during comparisions and may try to rely on pure equals:

      • there is a Set of RexNode-s during AND simplification and in RexUtil as well
      • I've by mistake just written rexNode.equals(otherRexNode) during the implementation of CALCITE-1413
      • I've just bumped into the same thing...that RexUtil.andNot is also rely on it....and I think those comparisions go back a while (~3years at least) ; and a bug is not appeared from it because this comparision is in most cases false.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kgyrtkirk Zoltan Haindrich
                Reporter:
                kgyrtkirk Zoltan Haindrich
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: