zeroshade commented on a change in pull request #11359:
URL: https://github.com/apache/arrow/pull/11359#discussion_r744291686
##########
File path: go/arrow/array/interval.go
##########
@@ -279,6 +341,28 @@ func (a *DayTimeInterval) setData(data *Data) {
}
}
+func (a *DayTimeInterval) getOneForMarshal(i int) interface{} {
+ if a.IsValid(i) {
+ return a.values[i]
+ }
+ return nil
+}
+
+func (a *DayTimeInterval) MarshalJSON() ([]byte, error) {
+ if a.NullN() == 0 {
+ return json.Marshal(a.values)
Review comment:
Just to add on since my last comment, I've since modified the Month
Interval to marshal as a string like you suggested as "1months" etc. but sure,
i'll add a specific comment on these marshal functions about their format so
it's not only on the top level "to json" functions.
--
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]