Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix equality of nested nullable FixedSizeBinary (#4637) #4670

Conversation

tustvold
Copy link
Contributor

@tustvold tustvold commented Aug 9, 2023

Which issue does this PR close?

Closes #4637

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Aug 9, 2023
@@ -80,7 +80,7 @@ pub(super) fn fixed_binary_equal(
lhs_start + lhs_nulls.offset(),
len,
);
let rhs_nulls = lhs.nulls().unwrap();
let rhs_nulls = rhs.nulls().unwrap();
Copy link
Contributor Author

@tustvold tustvold Aug 9, 2023

Choose a reason for hiding this comment

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

It is actually remarkably hard to construct a test case to exercise this, kudos to @kawadakk for finding one. The reason it is hard is at this point the null masks have already been checked for equality, so you need one side to have a different start offset from the other, such that when correctly offset the null buffers compare equal, but the underlying null buffers themselves are not actually equal

Copy link
Contributor

Choose a reason for hiding this comment

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

😮 -- nice find @kawadakk and @tustvold

@tustvold tustvold requested a review from alamb August 10, 2023 07:10
@tustvold tustvold merged commit a41248a into apache:master Aug 10, 2023
25 checks passed
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

love it ❤️

@@ -80,7 +80,7 @@ pub(super) fn fixed_binary_equal(
lhs_start + lhs_nulls.offset(),
len,
);
let rhs_nulls = lhs.nulls().unwrap();
let rhs_nulls = rhs.nulls().unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

😮 -- nice find @kawadakk and @tustvold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List(FixedSizeBinary) array equality check may return wrong result
3 participants