[HUDI-8513] Fix equals in HoodieRecordGlobalLocation#12255
[HUDI-8513] Fix equals in HoodieRecordGlobalLocation#12255yihua merged 1 commit intoapache:masterfrom
Conversation
| && Objects.equals(instantTime, otherLoc.instantTime) | ||
| && Objects.equals(fileId, otherLoc.fileId) | ||
| && Objects.equals(position, otherLoc.position); | ||
| && Objects.equals(fileId, otherLoc.fileId); |
There was a problem hiding this comment.
are there any side effects wrt positional deletes if we remove position from equals? Also, don't we need to keep the same fields in hashcode as well?
There was a problem hiding this comment.
The hashCode function does not use position at the first place. Do not use any use case. HoodieRecordLocation has the same logic.
There was a problem hiding this comment.
If the position is not even used anywhere, we better remove it from the class, the only usage is from HoodieKeyLocationFetchHandle.globalLocations, where the getHoodieKeyIterator should be used instead of fetchRecordKeysWithPositions.
There was a problem hiding this comment.
I meant the position is used from this class, but there should not be any cases where we need to group records at position level.
There was a problem hiding this comment.
I didn't see any usesage of the position outside this class, can you confirm that?
There was a problem hiding this comment.
HoodieGlobalSimpleIndex#tagLocationInternal uses fetchRecordGlobalLocations which put the position of records into the HoodieRecordGlobalLocation instances. Such instance is later put into the corresponding HoodieRecord instance if the record is an update.
6d2a08f to
4027e0e
Compare
|
Re-trigger the CI. |
4027e0e to
8cad794
Compare
| && Objects.equals(instantTime, otherLoc.instantTime) | ||
| && Objects.equals(fileId, otherLoc.fileId) | ||
| && Objects.equals(position, otherLoc.position); | ||
| && Objects.equals(fileId, otherLoc.fileId); |
There was a problem hiding this comment.
HoodieGlobalSimpleIndex#tagLocationInternal uses fetchRecordGlobalLocations which put the position of records into the HoodieRecordGlobalLocation instances. Such instance is later put into the corresponding HoodieRecord instance if the record is an update.
Change Logs
We remove the
positionfrom theequalsfunction; otherwise, the workload profile will be huge and can cause OOM issue.Impact
Better performance when using global indexes.
Risk level (write none, low medium or high below)
Low.
Documentation Update
Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none".
ticket number here and follow the instruction to make
changes to the website.
Contributor's checklist