You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/07/03 19:10:57 UTC

[GitHub] [arrow-datafusion] alamb opened a new pull request, #6834: Minor: Add one more assert to `hash_array_primitive`

alamb opened a new pull request, #6834:
URL: https://github.com/apache/arrow-datafusion/pull/6834

   # Which issue does this PR close?
   
   Follow on to https://github.com/apache/arrow-datafusion/pull/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
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #6834: Minor: Add one more assert to `hash_array_primitive`

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #6834:
URL: https://github.com/apache/arrow-datafusion/pull/6834#discussion_r1251208791


##########
datafusion/physical-expr/src/hash_utils.rs:
##########
@@ -96,6 +96,12 @@ fn hash_array_primitive<T>(
     T: ArrowPrimitiveType,
     <T as arrow_array::ArrowPrimitiveType>::Native: HashValue,
 {
+    assert_eq!(

Review Comment:
   this is the same assert copied from a few  lines down and makes me feel better about
   
   ```rust
                   let value = unsafe { array.value_unchecked(i) };
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb merged pull request #6834: Minor: Add one more assert to `hash_array_primitive`

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #6834:
URL: https://github.com/apache/arrow-datafusion/pull/6834


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org