zeroshade commented on code in PR #39674:
URL: https://github.com/apache/arrow/pull/39674#discussion_r1457670732


##########
go/arrow/compute/internal/kernels/cast_temporal.go:
##########
@@ -125,6 +129,10 @@ func TimestampToDate64(ctx *exec.KernelCtx, batch 
*exec.ExecSpan, out *exec.Exec
 
        return ScalarUnaryNotNull(func(_ *exec.KernelCtx, arg0 arrow.Timestamp, 
_ *error) arrow.Date64 {
                tm := fnToTime(arg0)
+               if _, offset := tm.Zone(); offset != 0 {
+                       // normalize the tm
+                       tm = tm.Add(time.Duration(offset) * time.Second).UTC()
+               }

Review Comment:
   Yes. Because as you pointed out above, when we call `.Unix()` it returns the 
result *not according to the location* but we want it to represent the date in 
the timezone's location, without having a timezone mark associated. This 
matches the C++ implementation of the casting in acero  (which is where I got 
the idea)



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