lidavidm commented on code in PR #13539:
URL: https://github.com/apache/arrow/pull/13539#discussion_r917026906


##########
cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc:
##########
@@ -168,8 +168,8 @@ struct TemporalComponentExtractWeek
 template <template <typename...> class Op, typename Duration, typename InType,
           typename OutType>
 struct TemporalComponentExtractRound
-    : public TemporalComponentExtractBase<Op, Duration, InType, OutType> {
-  using Base = TemporalComponentExtractBase<Op, Duration, InType, OutType>;
+    : public TemporalComponentExtractBase<Op, Duration, InType, InType> {
+  using Base = TemporalComponentExtractBase<Op, Duration, InType, InType>;

Review Comment:
   I think the type resolver was working (else the test would have failed 
differently, the types would be wrong instead of the values) but 
UnaryTemporalFactory was passing the OutType onto the Exec template class which 
was using it for ScalarUnary: 
https://github.com/apache/arrow/blob/047202f5647e67dbc09c6080468675ebb7a78c44/cpp/src/arrow/compute/kernels/temporal_internal.h#L224
   That in turn was probably truncating the values when writing to the output 
array: 
https://github.com/apache/arrow/blob/047202f5647e67dbc09c6080468675ebb7a78c44/cpp/src/arrow/compute/kernels/codegen_internal.h#L587



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