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/11/03 01:54:59 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3006: Replace hour_generic with hour_dyn

tustvold commented on code in PR #3006:
URL: https://github.com/apache/arrow-rs/pull/3006#discussion_r1012435881


##########
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:
   I presume the body of this will be extracted into a generic function as part of converting the 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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org