zeroshade commented on code in PR #1110:
URL: https://github.com/apache/arrow-go/pull/1110#discussion_r3737703397


##########
arrow/scalar/temporal.go:
##########
@@ -148,11 +148,27 @@ func castTemporal(from TemporalScalar, to arrow.DataType) 
(Scalar, error) {
                case *arrow.TimestampType:
                        return 
NewTimestampScalar(arrow.Timestamp(arrow.ConvertTimestampValue(s.Unit(), 
to.Unit, int64(s.Value))), to), nil
                case *arrow.Date32Type:
-                       millis := arrow.ConvertTimestampValue(s.Unit(), 
arrow.Millisecond, int64(s.Value))
-                       return NewDate32Scalar(arrow.Date32(millis / 
int64(millisecondsInDay))), nil
+                       timestampType := s.DataType().(*arrow.TimestampType)
+                       toTime, err := timestampType.GetToTimeFunc()

Review Comment:
   the `toTime` func should already be handling the timestamp offset by using 
`.In`, so we shouldn't need to separately add the offset like you're doing



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