viirya commented on code in PR #1990:
URL: https://github.com/apache/arrow-rs/pull/1990#discussion_r915171084
##########
arrow/src/compute/kernels/arity.rs:
##########
@@ -103,8 +103,22 @@ where
.collect::<PrimitiveArray<T>>();
let keys = array.keys();
- let new_dict = DictionaryArray::<K>::try_new(keys, &values).unwrap();
+ let mut data = ArrayData::builder(array.data_type().clone())
Review Comment:
I thought about it. I think for mostly usage in query execution,
input/output types are the same for `unary`. A difficulty to specify output
type for `unary_dict` is, unlike `unary` where we can bind output type on the
produced `PrimitiveArray<O>` and `F: Fn(T::Native) -> T::Native`. In
`unary_dict`, the output type `O` cannot be bound on the produce dictionary
array. So the compiler cannot infer it. Then we need to specify `O` when
invoking `unary_dict`/`unary_dyn`. I feel it is harder to use. So if we only
use it for same input/output types, I just leave it without a separate output
type parameter.
--
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]