liukun4515 commented on a change in pull request #1388:
URL: https://github.com/apache/arrow-rs/pull/1388#discussion_r818375780



##########
File path: arrow/src/compute/kernels/temporal.rs
##########
@@ -169,6 +169,23 @@ where
     Ok(b.finish())
 }
 
+/// Extracts the month of a given temporal array as an array of integers
+pub fn month<T>(array: &PrimitiveArray<T>) -> Result<Int32Array>
+where
+    T: ArrowTemporalType + ArrowNumericType,
+    i64: std::convert::From<T::Native>,
+{
+    let mut b = Int32Builder::new(array.len());
+    match array.data_type() {
+        &DataType::Date32 | &DataType::Date64 | &DataType::Timestamp(_, _) => {
+            extract_component_from_array!(array, b, month, value_as_datetime)

Review comment:
       I think the `timezone` will impact `hour, day, month, year` and other  
time unit which are higher than hour.




-- 
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]


Reply via email to