viirya commented on code in PR #2608:
URL: https://github.com/apache/arrow-rs/pull/2608#discussion_r960034640


##########
arrow/src/compute/kernels/temporal.rs:
##########
@@ -28,33 +28,33 @@ use chrono::format::{parse, Parsed};
 use chrono::FixedOffset;
 
 macro_rules! extract_component_from_array {
-    ($array:ident, $builder:ident, $extract_fn:ident, $using:ident) => {
+    ($array:ident, $builder:ident, $extract_fn:ident, $using:ident, 
$convert:expr) => {

Review Comment:
   The result type of `hour` etc is Int32Array, but these APIs of `Timelike` 
(`hour`, `minute`, `second` etc) return u32. Previously in this macro, it is 
hardcoded as something like `dt.$extract_fn() as i32`. But for `to_string` API 
that is called for `cast` kernel, we don't need any conversion. In order to 
reuse this macro, I add this `$convert` to extract `as i32` part.



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to