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

Minor: Add one more assert to hash_array_primitive #6834

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Jul 3, 2023

Which issue does this PR close?

Follow on to #6816 from @Dandandan

Rationale for this change

There are some unsafe blocks in this function, so I would like to make it more obvious that they are ok

What changes are included in this PR?

Add the same assert to hash_array_primitive as are in hash_array

Are these changes tested?

existing tests

Are there any user-facing changes?

@github-actions github-actions bot added the physical-expr Changes to the physical-expr crates label Jul 3, 2023
@@ -96,6 +96,12 @@ fn hash_array_primitive<T>(
T: ArrowPrimitiveType,
<T as arrow_array::ArrowPrimitiveType>::Native: HashValue,
{
assert_eq!(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the same assert copied from a few lines down and makes me feel better about

                let value = unsafe { array.value_unchecked(i) };

@alamb alamb marked this pull request as ready for review July 3, 2023 19:11
@alamb alamb requested a review from Dandandan July 3, 2023 19:11
Copy link
Contributor

@Dandandan Dandandan left a comment

Choose a reason for hiding this comment

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

Thanks - forgot this one.

@alamb alamb merged commit 4ff0a8e into apache:main Jul 3, 2023
@alamb alamb deleted the alamb/one_more_assert branch July 3, 2023 20:38
2010YOUY01 pushed a commit to 2010YOUY01/arrow-datafusion that referenced this pull request Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
physical-expr Changes to the physical-expr crates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants