yanlin-Lynn commented on a change in pull request #1531: [CALCITE-3447] Fix
equals and hashcode methods of class MutableScan
URL: https://github.com/apache/calcite/pull/1531#discussion_r340422031
##########
File path: core/src/main/java/org/apache/calcite/rel/mutable/MutableScan.java
##########
@@ -36,11 +36,11 @@ public static MutableScan of(TableScan scan) {
@Override public boolean equals(Object obj) {
return obj == this
|| obj instanceof MutableScan
- && rel.equals(((MutableScan) obj).rel);
+ && rel.getTable().equals(((MutableScan) obj).rel.getTable());
}
Review comment:
Personally, I would perfer to make `MaterializedViewSubstitutionVisitor` non
public and keep `hashCode` and `equals` unchanged.
Or you can compare using the digest and row type of the rel object inside
`MutableScan`, just like the HepPlanner does, how do you think about that?
https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java#L915
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services