zeroshade commented on code in PR #418:
URL: https://github.com/apache/arrow-go/pull/418#discussion_r2162014762
##########
arrow/compute/utils.go:
##########
@@ -353,19 +354,45 @@ func commonTemporal(vals ...arrow.DataType)
arrow.DataType {
}
zone = &ts.TimeZone
finestUnit = exec.Max(finestUnit, ts.Unit)
+ case arrow.TIME32, arrow.TIME64:
+ ts := ty.(arrow.TemporalWithUnit)
+ finestUnit = max(finestUnit, ts.TimeUnit())
+ sawTime = true
+ case arrow.DURATION:
+ ts := ty.(*arrow.DurationType)
+ finestUnit = max(finestUnit, ts.Unit)
+ sawDuration = true
default:
return nil
}
}
- switch {
- case zone != nil:
- // at least one timestamp seen
- return &arrow.TimestampType{Unit: finestUnit, TimeZone: *zone}
- case sawDate64:
- return arrow.FixedWidthTypes.Date64
- case sawDate32:
- return arrow.FixedWidthTypes.Date32
+ sawTimestampOrDate := zone != nil || sawDate32 || sawDate64 ||
sawDuration
Review Comment:
Was following the existing
[`CommonTemporal`](https://github.com/apache/arrow/blob/dacec3080f8a7c245dc884d278ea6280942086f0/cpp/src/arrow/compute/kernels/codegen_internal.cc#L314)
in arrow C++. Should we also change that function too?
--
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]