Skip to content

GH-49073: [C++] Remove the TODO asking to remove check_metadata in compare.cc#49077

Open
HyukjinKwon wants to merge 1 commit intoapache:mainfrom
HyukjinKwon:GH-49073
Open

GH-49073: [C++] Remove the TODO asking to remove check_metadata in compare.cc#49077
HyukjinKwon wants to merge 1 commit intoapache:mainfrom
HyukjinKwon:GH-49073

Conversation

@HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Jan 30, 2026

Rationale for this change

The TypeEquals() function has a fallback path for types without fingerprints, but it was not passing through the check_metadata parameter to TypeEqualsVisitor. While this is an really rare corner case, the check should still be there to prevent potential mistakes when, e.g., adding new types in the future.

What changes are included in this PR?

  • Added test case TestNestedType.FieldMetadataComparisonWithEmptyFingerprints to verify the fix
  • Updated the TODO comment to clarify why the parameter must be passed through.

Are these changes tested?

Yes, unittest was added.

Are there any user-facing changes?

No.

AssertFieldNotEqual(*u0, *u0_bad);
}

TEST(TestNestedType, FieldMetadataComparisonWithEmptyFingerprints) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This might be too much. I am fine with removing this test case if anyone thinks so. It's more to demonstrate the case of triggering check_metadata.

@github-actions github-actions bot added awaiting review Awaiting review Component: C++ awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jan 30, 2026
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.

1 participant