matthewmturner commented on a change in pull request #984:
URL: https://github.com/apache/arrow-rs/pull/984#discussion_r761341465
##########
File path: arrow/src/compute/kernels/comparison.rs
##########
@@ -200,6 +201,42 @@ macro_rules! compare_op_scalar_primitive {
}};
}
+macro_rules! compare_dict_op_scalar {
+ ($left:expr, $right:expr, $op:expr) => {{
+ let null_bit_buffer = $left
+ .data()
+ .null_buffer()
+ .map(|b| b.bit_slice($left.offset(), $left.len()));
+
+ let values = $left
+ .values()
+ .as_any()
+ .downcast_ref::<StringArray>()
+ .unwrap();
+
+ // Safety:
+ // `i < $left.len()`
+ let comparison = (0..$left.len()).map(|i| unsafe {
+ let key = $left.keys().value_unchecked(i).to_usize().unwrap();
+ $op(values.value_unchecked(key), $right)
+ });
Review comment:
@alamb im struggling with the second step in your pseudocode given that
my understanding is that the values could be of any `ArrowPrimativeType`.
Would you be able to provide guidance on how to handle that? I've been playing
with different macros and iteration options on the underlying buffers, but i
feel like im missing some fundamental understanding about how to work with
dynamic data type like this or how to use `ArrayData`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]