You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/02/17 09:56:53 UTC

[GitHub] [arrow-rs] viirya opened a new pull request #1330: Use DictionaryArray's iterator

viirya opened a new pull request #1330:
URL: https://github.com/apache/arrow-rs/pull/1330


   # Which issue does this PR close?
   
   <!---
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #1329.
   
   # Rationale for this change
    
    <!---
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   # What changes are included in this PR?
   
   <!---
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # 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 `breaking 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-rs] alamb commented on pull request #1330: Use DictionaryArray's iterator in `compare_dict_op`

Posted by GitBox <gi...@apache.org>.
alamb commented on pull request #1330:
URL: https://github.com/apache/arrow-rs/pull/1330#issuecomment-1043274603


   > Thanks @alamb . As we don't know if the keys in key iterator are fully in the valid range,seems we cannot skipping bounds check in take_iter? 
   
   That is true in general. However, if we are iterating over a set of keys from a known valid `DictionaryArray` the indexes are known to be valid
   
   > If it is critical, maybe we can have take_iter_unchecked in the future if it is necessary?
   
   I think this is wise strategy


-- 
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-rs] viirya commented on pull request #1330: Use DictionaryArray's iterator in `compare_dict_op`

Posted by GitBox <gi...@apache.org>.
viirya commented on pull request #1330:
URL: https://github.com/apache/arrow-rs/pull/1330#issuecomment-1054673219


   Thank you @alamb !


-- 
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-rs] viirya commented on pull request #1330: Use DictionaryArray's iterator in `compare_dict_op`

Posted by GitBox <gi...@apache.org>.
viirya commented on pull request #1330:
URL: https://github.com/apache/arrow-rs/pull/1330#issuecomment-1043252680


   > The only potential concern I have here is that the `take_iter()s` use `value()` instead of `value_unchecked()` -- though perhaps we can merge this PR in and then add some additional unsafe / skipping bounds checking if it turns out to be in anyone's critical path / shows up in profiles
   
   Thanks @alamb . As we don't know if the keys in key iterator are fully in the valid range, seems we cannot skipping bounds check in `take_iter`? If it is critical, maybe we can have `take_iter_unchecked` in the future if it is necessary?


-- 
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-rs] alamb commented on a change in pull request #1330: Use DictionaryArray's iterator in `compare_dict_op`

Posted by GitBox <gi...@apache.org>.
alamb commented on a change in pull request #1330:
URL: https://github.com/apache/arrow-rs/pull/1330#discussion_r809058225



##########
File path: arrow/src/compute/kernels/comparison.rs
##########
@@ -2213,27 +2213,26 @@ macro_rules! compare_dict_op {
                     .to_string(),
             ));
         }
-        let left_values = $left.values().as_any().downcast_ref::<$value_ty>().unwrap();
-        let right_values = $right
+
+        let left_iter = $left

Review comment:
       This sure looks much nicer 👍 




-- 
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-rs] alamb commented on pull request #1330: Use DictionaryArray's iterator in `compare_dict_op`

Posted by GitBox <gi...@apache.org>.
alamb commented on pull request #1330:
URL: https://github.com/apache/arrow-rs/pull/1330#issuecomment-1054653158


   I filed https://github.com/apache/arrow-rs/issues/1371 for follow on performance work and I am merging this one in now 🚀  
   
   thanks @viirya 


-- 
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-rs] alamb merged pull request #1330: Use DictionaryArray's iterator in `compare_dict_op`

Posted by GitBox <gi...@apache.org>.
alamb merged pull request #1330:
URL: https://github.com/apache/arrow-rs/pull/1330


   


-- 
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