[CALCITE-3514] LatticeTest fails when JdbcSchema re-computes JdbcTables#1594
[CALCITE-3514] LatticeTest fails when JdbcSchema re-computes JdbcTables#1594DonnyZone wants to merge 1 commit into
Conversation
| sourceExpressionList, flattened); | ||
| } | ||
|
|
||
| @Override public boolean equals(Object obj) { |
There was a problem hiding this comment.
even though this is trying to fix CALCITE-3514, because this is a general purpose equals implementation, it should checks equality of all fields of this class. Same for hashcode.
There was a problem hiding this comment.
I disagree. Two tables are identical if they have the same name, schema etc. No need to check columns.
The "equals" contract does not say you have to check every field.
There was a problem hiding this comment.
O I see. So if schema name is the same then it guarantees that two tables will be the same (e.g. no need to check the schema), in that case it would make sense.
I mentioned every field in checking just because I made no assumption beyond this function. Indeed "equals" not require what is checked.
There was a problem hiding this comment.
I add a variable in JdbcSchema to trigger the issue.
80f411d to
ca27fe9
Compare
49cb002 to
8768a23
Compare
8a5cf83 to
cf7f71b
Compare
As illustrated in CALCITE-3514, we need to implement
JdbcTable'sequals()andhashCode()methods.