diff --git a/go/arrow/ipc/file_reader.go b/go/arrow/ipc/file_reader.go index 4f8646eb11c..fef552d0088 100644 --- a/go/arrow/ipc/file_reader.go +++ b/go/arrow/ipc/file_reader.go @@ -361,6 +361,9 @@ func (ctx *arrayLoaderContext) loadArray(dt arrow.DataType) array.Interface { *arrow.Float32Type, *arrow.Float64Type: return ctx.loadPrimitive(dt) + case *arrow.BinaryType, *arrow.StringType: + return ctx.loadBinary(dt) + default: panic(errors.Errorf("array type %T not handled yet", dt)) } @@ -409,6 +412,16 @@ func (ctx *arrayLoaderContext) loadPrimitive(dt arrow.DataType) array.Interface return array.MakeFromData(data) } +func (ctx *arrayLoaderContext) loadBinary(dt arrow.DataType) array.Interface { + field, buffers := ctx.loadCommon(3) + buffers = append(buffers, ctx.buffer(), ctx.buffer()) + + data := array.NewData(dt, int(field.Length()), buffers, nil, int(field.NullCount()), 0) + defer data.Release() + + return array.MakeFromData(data) +} + func readDictionary(meta *memory.Buffer, types dictTypeMap, r ReadAtSeeker) (int64, array.Interface, error) { // msg := flatbuf.GetRootAsMessage(meta.Bytes(), 0) // var dictBatch flatbuf.DictionaryBatch