hunght3101 opened a new issue #9735:
URL: https://github.com/apache/arrow/issues/9735
@user
I am a new golang in Apache Arrow.
Now i am trying serialization Apache Arrow to Flatbuffers using ipc package.
But i dont understand to create a message ipc format for input of ipc.Reader
function.
Could you show me any example message ipc format ? or method for create a
message ipc format?
My source:
```
import (
"fmt"
"github.com/apache/arrow/go/arrow"
"github.com/apache/arrow/go/arrow/array"
"github.com/apache/arrow/go/arrow/ipc"
"github.com/apache/arrow/go/arrow/memory"
"io"
"strings"
)
func main() {
meta := arrow.NewMetadata([]string{"k1", "k2"}, []string{"v1", "v2"})
mem := memory.NewGoAllocator()
schema := arrow.NewSchema(
[]arrow.Field{
arrow.Field{Name: "f1-i32", Type:
arrow.BinaryTypes.String},
arrow.Field{Name: "f2-f64", Type:
arrow.BinaryTypes.String},
},
&meta,
)
b := array.NewRecordBuilder(mem, schema)
defer b.Release()
b.Field(0).(*array.StringBuilder).AppendValues(
[]string{"1", "2"},
nil,
)
b.Field(0).(*array.StringBuilder).AppendValues(
[]string{"1", "2","1", "2"},
[]bool{true, true, false, true},
)
b.Field(1).(*array.StringBuilder).AppendValues(
[]string{"1", "2","1", "2","1", "2","1", "2","1", "2"},
nil,
)
var r io.Reader
r = strings.NewReader("Object Apache Arrow")
rr, err := ipc.NewReader(r, ipc.WithSchema(schema),
ipc.WithAllocator(mem))
if err != nil {
fmt.Println(err)
}
fmt.Println(rr)
}
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]