kazantsev-maksim commented on code in PR #18273:
URL: https://github.com/apache/datafusion/pull/18273#discussion_r2463214056
##########
datafusion/spark/src/function/bitmap/bitmap_count.rs:
##########
@@ -100,6 +101,22 @@ pub fn bitmap_count_inner(arg: &[ArrayRef]) ->
Result<ArrayRef> {
FixedSizeBinary(_size) => {
downcast_and_count_ones!(input_array, FixedSizeBinaryArray)
}
+ Dictionary(k, v) if k.as_ref() == &DataType::Int32 && v.as_ref() ==
&Binary => {
+ let dict_array = as_dictionary_array::<Int32Type>(input_array);
+ let binary_array = as_binary_array(dict_array.values())?;
+
+ let result: Int64Array = dict_array
+ .keys()
+ .iter()
+ .map(|key| {
+ key.and_then(|k| {
+ binary_count_ones(Some(binary_array.value(k as usize)))
+ })
+ })
+ .collect();
+
+ Ok(result)
+ }
Review Comment:
Thanks, fixed.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]