Skip to content

Core: Don't override equals() and hashCode() in V4 DeletionVector - #17447

Open
gaborkaszab wants to merge 1 commit into
apache:mainfrom
gaborkaszab:main_remove_deletionvector_equals
Open

Core: Don't override equals() and hashCode() in V4 DeletionVector#17447
gaborkaszab wants to merge 1 commit into
apache:mainfrom
gaborkaszab:main_remove_deletionvector_equals

Conversation

@gaborkaszab

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added the core label Jul 31, 2026
@gaborkaszab
gaborkaszab force-pushed the main_remove_deletionvector_equals branch from 405ddb5 to 544114f Compare July 31, 2026 10:58
@gaborkaszab

Copy link
Copy Markdown
Contributor Author

cc @anoopj @stevenzwu @rdblue

@anoopj anoopj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good to me. We don't rely on this currently so let's remove it.

@kevinjqliu

Copy link
Copy Markdown
Contributor

im curious, what is the reasoning to remove these? It seems useful. Would it be a surprise later on when comparing DeletionVector?

I see it was added originally in 7c13104#diff-44ec3b66acad90f4f873b3786f55feb62bb03287626b41bd4622c11d5ca9963fR132-R150

}

@Override
public boolean equals(Object other) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No comment documents the intended equality contract after this change. Equality is now identity-based, and the safety of that choice rests on the invariant that no caller puts DeletionVectorStruct in a Set/Map key or calls .equals() for value comparison. As key_metadata (#17438) and further V4 fields land, a future reader writing dedup/caching code could reasonably assume value equality is in place. A single class-level sentence; e.g. "Equality and hash code are identity-based; DeletionVectorStruct is a projection-backed view, not a value type" would protect this invariant. This is the same documentation gap present in none of the sibling structs (TrackedFileStruct etc.), so adding it here sets a useful precedent for the whole V4 family.

@uros-b uros-b left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaborkaszab Please note that the PR body is currently empty: no description, no linked issue, no rationale. Iceberg convention expects a description explaining why the override is being removed.

@nssalian

nssalian commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

@gaborkaszab the Rationale for this change isn't clear. Please add more details and context since reviewers here might not be aware. Happy to take a look once the reasoning is fleshed out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants