Conversation
| public int hashCode() | ||
| { | ||
| return Objects.hash(schemaName, tableName); | ||
| return Objects.hash( |
There was a problem hiding this comment.
do we need hashCode/equals at all for ConnectorTableHandle? If so then then they should be listed in SPI. How did you find that? Is there any Presto behavior change with this? Maybe we should remove these methods from Presto if they are not used?
| Objects.equals(tableParameters, that.tableParameters) && | ||
| Objects.equals(partitionColumns, that.partitionColumns) && | ||
| Objects.equals(partitions, that.partitions) && | ||
| Objects.equals(compactEffectivePredicate, that.compactEffectivePredicate) && |
There was a problem hiding this comment.
Some of these fields (e.g., compactEffectivePredicate, enforcedPredicate) are not part of the identity of a hive "virtual" table. Handles should be equal to each other if they represent the same "object" (handles should be thought of like opaque IDs).
There was a problem hiding this comment.
If a handle represents table+predicate, it's no longer "the same" as handle representing a table.
Later on we will likely introduce table handles modelling a pushed down join.
Maybe we should remove equals from table handles? And treat them truly opaque?
There was a problem hiding this comment.
Maybe we should remove equals from table handles? And treat them truly opaque?
They are opaque (from the point of view that the engine doesn't care about what's inside), but just like an id, you should be able to test id1 == id2 to see if they are the same. At some point we'll need that for some forms of memoization in the optimizer.
There was a problem hiding this comment.
Okay, so they are opaque but need to implement equals().
- we need document this requirement at SPI interface level
HiveTableHandleas it is today doesn't meet memo's requirements, since it ignores part of its (important) state in equals
if you agree, we should proceed with the PR, right?
6c8c1fc to
894953b
Compare
|
Rebased to re-run travis. (The change was last tested against 318) |
894953b to
cdc87e8
Compare
`HiveTableHandle.equals()` got simplified in a389636.
cdc87e8 to
49e6255
Compare
HiveTableHandle.equals()got simplified ina389636.