go

command
v0.0.0-...-d55177b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2018 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 5 Imported by: 0

README

Arrow Go example

There are Go example codes in this directory.

How to run

All example codes use go-gir-generator to use Arrow GLib based bindings.

See ../../README.md how to install Arrow GLib. You can use packages to install Arrow GLib. The following instructions assumes that you've installed Arrow GLib by package. Package name is libarrow-glib-dev on Debian GNU/Linux and Ubuntu, arrow-glib-devel on CentOS.

Here are command lines to install go-gir-generator on Debian GNU/Linux and Ubuntu:

% sudo apt install -V -y libarrow-glib-dev golang git libgirepository1.0-dev libgudev-1.0-dev
% export GOPATH=$HOME
% go get github.com/linuxdeepin/go-gir-generator
% cd $GOPATH/src/github.com/linuxdeepin/go-gir-generator
% make build copyfile
% mkdir -p $GOPATH/bin/
% cp -a out/gir-generator $GOPATH/bin/
% cp -a out/src/gir/ $GOPATH/src/

Now, you can generate Arrow bindings for Go:

% git clone https://github.com/apache/arrow.git ~/arrow
% cd ~/arrow/c_glib/example/go
% make generate

Then you can build all example codes:

% cd ~/arrow/c_glib/example/go
% make
% ./write-batch  # Write data in batch mode
% ./read-batch   # Read the written batch mode data
% ./write-stream # Write data in stream mode
% ./read-stream  # Read the written stream mode data

Go example codes

Here are example codes in this directory:

  • write-batch.go: It shows how to write Arrow array to file in batch mode.

  • read-batch.go: It shows how to read Arrow array from file in batch mode.

  • write-stream.go: It shows how to write Arrow array to file in stream mode.

  • read-stream.go: It shows how to read Arrow array from file in stream mode.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL