zeroshade commented on a change in pull request #11359:
URL: https://github.com/apache/arrow/pull/11359#discussion_r742845861
##########
File path: go/arrow/array/fixed_size_list.go
##########
@@ -110,6 +112,44 @@ func (a *FixedSizeList) Release() {
a.values.Release()
}
+func (a *FixedSizeList) getOneForMarshal(i int) interface{} {
+ if a.IsNull(i) {
+ return nil
+ }
+ slice := a.newListValue(i)
+ defer slice.Release()
+ v, err := json.Marshal(slice)
+ if err != nil {
+ panic(err)
+ }
+
+ return json.RawMessage(v)
+}
+
+func (a *FixedSizeList) MarshalJSON() ([]byte, error) {
+ var buf bytes.Buffer
+ enc := json.NewEncoder(&buf)
+
+ buf.WriteByte('[')
Review comment:
I can understand the confusion now that I think about it. The return
from `MarshalJSON` is the byte slice of the raw JSON that is produced by the
conversion. I hope that clears things up a bit.
--
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]