viirya commented on code in PR #3006:
URL: https://github.com/apache/arrow-rs/pull/3006#discussion_r1012470577
##########
arrow/src/compute/kernels/temporal.rs:
##########
@@ -180,21 +182,74 @@ where
T: ArrowTemporalType + ArrowNumericType,
i64: From<T::Native>,
{
- hour_generic::<T, _>(array)
+ hour_internal::<T, _>(array, array.data_type())
}
-/// Extracts the hours of a given temporal array as an array of integers within
-/// the range of [0, 23].
-pub fn hour_generic<T, A: ArrayAccessor<Item = T::Native>>(array: A) ->
Result<Int32Array>
-where
- T: ArrowTemporalType + ArrowNumericType,
- i64: From<T::Native>,
-{
+/// Extracts the hours of a given array as an array of integers within
+/// the range of [0, 23]. If the given array isn't temporal primitive or
dictionary array,
+/// an `Err` will be returned.
+pub fn hour_dyn(array: &dyn Array) -> Result<ArrayRef> {
Review Comment:
Yea, I will try to extract this when I work on other functions.
--
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]