liukun4515 commented on a change in pull request #1376:
URL: https://github.com/apache/arrow-rs/pull/1376#discussion_r816676265
##########
File path: arrow/src/compute/kernels/temporal.rs
##########
@@ -197,6 +211,24 @@ where
Ok(b.finish())
}
+/// Extracts the week of a given temporal array as an array of integers
+pub fn week<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(_, None)
=> {
Review comment:
we need to consider the `timezone` when support the `Timestamp` type.
--
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]