You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2017/03/17 01:09:56 UTC
[9/9] arrow git commit: ARROW-631: [GLib] Import
ARROW-631: [GLib] Import
See also https://issues.apache.org/jira/browse/ARROW-631 and `glib/README.md` in this change.
Author: Kouhei Sutou <ko...@clear-code.com>
Closes #382 from kou/glib-import and squashes the following commits:
67a5d24 [Kouhei Sutou] [GLib] Rename directory to c_glib/ from glib/
24cd605 [Kouhei Sutou] [GLib] Import
Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/39c7274f
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/39c7274f
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/39c7274f
Branch: refs/heads/master
Commit: 39c7274fc36b5f405f1dbfa48067dde52abec5ce
Parents: c13d671
Author: Kouhei Sutou <ko...@clear-code.com>
Authored: Thu Mar 16 21:09:38 2017 -0400
Committer: Wes McKinney <we...@twosigma.com>
Committed: Thu Mar 16 21:09:38 2017 -0400
----------------------------------------------------------------------
.travis.yml | 5 +
c_glib/.gitignore | 44 ++
c_glib/Makefile.am | 26 ++
c_glib/README.md | 114 ++++++
c_glib/arrow-glib/Makefile.am | 494 +++++++++++++++++++++++
c_glib/arrow-glib/array-builder.cpp | 229 +++++++++++
c_glib/arrow-glib/array-builder.h | 70 ++++
c_glib/arrow-glib/array-builder.hpp | 26 ++
c_glib/arrow-glib/array.cpp | 268 ++++++++++++
c_glib/arrow-glib/array.h | 67 +++
c_glib/arrow-glib/array.hpp | 27 ++
c_glib/arrow-glib/arrow-glib.h | 80 ++++
c_glib/arrow-glib/arrow-glib.hpp | 37 ++
c_glib/arrow-glib/arrow-glib.pc.in | 28 ++
c_glib/arrow-glib/arrow-io-glib.h | 32 ++
c_glib/arrow-glib/arrow-io-glib.hpp | 30 ++
c_glib/arrow-glib/arrow-io-glib.pc.in | 28 ++
c_glib/arrow-glib/arrow-ipc-glib.h | 27 ++
c_glib/arrow-glib/arrow-ipc-glib.hpp | 30 ++
c_glib/arrow-glib/arrow-ipc-glib.pc.in | 28 ++
c_glib/arrow-glib/binary-array-builder.cpp | 122 ++++++
c_glib/arrow-glib/binary-array-builder.h | 77 ++++
c_glib/arrow-glib/binary-array.cpp | 73 ++++
c_glib/arrow-glib/binary-array.h | 72 ++++
c_glib/arrow-glib/binary-data-type.cpp | 67 +++
c_glib/arrow-glib/binary-data-type.h | 69 ++++
c_glib/arrow-glib/boolean-array-builder.cpp | 120 ++++++
c_glib/arrow-glib/boolean-array-builder.h | 76 ++++
c_glib/arrow-glib/boolean-array.cpp | 69 ++++
c_glib/arrow-glib/boolean-array.h | 70 ++++
c_glib/arrow-glib/boolean-data-type.cpp | 67 +++
c_glib/arrow-glib/boolean-data-type.h | 69 ++++
c_glib/arrow-glib/chunked-array.cpp | 241 +++++++++++
c_glib/arrow-glib/chunked-array.h | 78 ++++
c_glib/arrow-glib/chunked-array.hpp | 27 ++
c_glib/arrow-glib/column.cpp | 262 ++++++++++++
c_glib/arrow-glib/column.h | 82 ++++
c_glib/arrow-glib/column.hpp | 27 ++
c_glib/arrow-glib/data-type.cpp | 260 ++++++++++++
c_glib/arrow-glib/data-type.h | 72 ++++
c_glib/arrow-glib/data-type.hpp | 27 ++
c_glib/arrow-glib/double-array-builder.cpp | 120 ++++++
c_glib/arrow-glib/double-array-builder.h | 76 ++++
c_glib/arrow-glib/double-array.cpp | 69 ++++
c_glib/arrow-glib/double-array.h | 71 ++++
c_glib/arrow-glib/double-data-type.cpp | 68 ++++
c_glib/arrow-glib/double-data-type.h | 70 ++++
c_glib/arrow-glib/enums.c.template | 56 +++
c_glib/arrow-glib/enums.h.template | 41 ++
c_glib/arrow-glib/error.cpp | 81 ++++
c_glib/arrow-glib/error.h | 54 +++
c_glib/arrow-glib/error.hpp | 28 ++
c_glib/arrow-glib/field.cpp | 250 ++++++++++++
c_glib/arrow-glib/field.h | 83 ++++
c_glib/arrow-glib/field.hpp | 27 ++
c_glib/arrow-glib/float-array-builder.cpp | 120 ++++++
c_glib/arrow-glib/float-array-builder.h | 76 ++++
c_glib/arrow-glib/float-array.cpp | 69 ++++
c_glib/arrow-glib/float-array.h | 71 ++++
c_glib/arrow-glib/float-data-type.cpp | 68 ++++
c_glib/arrow-glib/float-data-type.h | 69 ++++
c_glib/arrow-glib/int16-array-builder.cpp | 120 ++++++
c_glib/arrow-glib/int16-array-builder.h | 76 ++++
c_glib/arrow-glib/int16-array.cpp | 69 ++++
c_glib/arrow-glib/int16-array.h | 71 ++++
c_glib/arrow-glib/int16-data-type.cpp | 67 +++
c_glib/arrow-glib/int16-data-type.h | 69 ++++
c_glib/arrow-glib/int32-array-builder.cpp | 120 ++++++
c_glib/arrow-glib/int32-array-builder.h | 76 ++++
c_glib/arrow-glib/int32-array.cpp | 69 ++++
c_glib/arrow-glib/int32-array.h | 71 ++++
c_glib/arrow-glib/int32-data-type.cpp | 67 +++
c_glib/arrow-glib/int32-data-type.h | 69 ++++
c_glib/arrow-glib/int64-array-builder.cpp | 120 ++++++
c_glib/arrow-glib/int64-array-builder.h | 76 ++++
c_glib/arrow-glib/int64-array.cpp | 69 ++++
c_glib/arrow-glib/int64-array.h | 71 ++++
c_glib/arrow-glib/int64-data-type.cpp | 67 +++
c_glib/arrow-glib/int64-data-type.h | 69 ++++
c_glib/arrow-glib/int8-array-builder.cpp | 120 ++++++
c_glib/arrow-glib/int8-array-builder.h | 76 ++++
c_glib/arrow-glib/int8-array.cpp | 69 ++++
c_glib/arrow-glib/int8-array.h | 71 ++++
c_glib/arrow-glib/int8-data-type.cpp | 67 +++
c_glib/arrow-glib/int8-data-type.h | 69 ++++
c_glib/arrow-glib/io-enums.c.template | 56 +++
c_glib/arrow-glib/io-enums.h.template | 41 ++
c_glib/arrow-glib/io-file-mode.cpp | 63 +++
c_glib/arrow-glib/io-file-mode.h | 40 ++
c_glib/arrow-glib/io-file-mode.hpp | 27 ++
c_glib/arrow-glib/io-file-output-stream.cpp | 231 +++++++++++
c_glib/arrow-glib/io-file-output-stream.h | 72 ++++
c_glib/arrow-glib/io-file-output-stream.hpp | 28 ++
c_glib/arrow-glib/io-file.cpp | 116 ++++++
c_glib/arrow-glib/io-file.h | 51 +++
c_glib/arrow-glib/io-file.hpp | 38 ++
c_glib/arrow-glib/io-input-stream.cpp | 56 +++
c_glib/arrow-glib/io-input-stream.h | 45 +++
c_glib/arrow-glib/io-input-stream.hpp | 38 ++
c_glib/arrow-glib/io-memory-mapped-file.cpp | 287 +++++++++++++
c_glib/arrow-glib/io-memory-mapped-file.h | 72 ++++
c_glib/arrow-glib/io-memory-mapped-file.hpp | 28 ++
c_glib/arrow-glib/io-output-stream.cpp | 56 +++
c_glib/arrow-glib/io-output-stream.h | 45 +++
c_glib/arrow-glib/io-output-stream.hpp | 38 ++
c_glib/arrow-glib/io-readable-file.cpp | 127 ++++++
c_glib/arrow-glib/io-readable-file.h | 55 +++
c_glib/arrow-glib/io-readable-file.hpp | 38 ++
c_glib/arrow-glib/io-readable.cpp | 84 ++++
c_glib/arrow-glib/io-readable.h | 51 +++
c_glib/arrow-glib/io-readable.hpp | 38 ++
c_glib/arrow-glib/io-writeable-file.cpp | 84 ++++
c_glib/arrow-glib/io-writeable-file.h | 51 +++
c_glib/arrow-glib/io-writeable-file.hpp | 38 ++
c_glib/arrow-glib/io-writeable.cpp | 106 +++++
c_glib/arrow-glib/io-writeable.h | 52 +++
c_glib/arrow-glib/io-writeable.hpp | 38 ++
c_glib/arrow-glib/ipc-enums.c.template | 56 +++
c_glib/arrow-glib/ipc-enums.h.template | 41 ++
c_glib/arrow-glib/ipc-file-reader.cpp | 247 ++++++++++++
c_glib/arrow-glib/ipc-file-reader.h | 83 ++++
c_glib/arrow-glib/ipc-file-reader.hpp | 28 ++
c_glib/arrow-glib/ipc-file-writer.cpp | 158 ++++++++
c_glib/arrow-glib/ipc-file-writer.h | 78 ++++
c_glib/arrow-glib/ipc-file-writer.hpp | 28 ++
c_glib/arrow-glib/ipc-metadata-version.cpp | 59 +++
c_glib/arrow-glib/ipc-metadata-version.h | 39 ++
c_glib/arrow-glib/ipc-metadata-version.hpp | 27 ++
c_glib/arrow-glib/ipc-stream-reader.cpp | 221 ++++++++++
c_glib/arrow-glib/ipc-stream-reader.h | 80 ++++
c_glib/arrow-glib/ipc-stream-reader.hpp | 28 ++
c_glib/arrow-glib/ipc-stream-writer.cpp | 232 +++++++++++
c_glib/arrow-glib/ipc-stream-writer.h | 82 ++++
c_glib/arrow-glib/ipc-stream-writer.hpp | 28 ++
c_glib/arrow-glib/list-array-builder.cpp | 173 ++++++++
c_glib/arrow-glib/list-array-builder.h | 77 ++++
c_glib/arrow-glib/list-array.cpp | 92 +++++
c_glib/arrow-glib/list-array.h | 73 ++++
c_glib/arrow-glib/list-data-type.cpp | 91 +++++
c_glib/arrow-glib/list-data-type.h | 73 ++++
c_glib/arrow-glib/null-array.cpp | 69 ++++
c_glib/arrow-glib/null-array.h | 70 ++++
c_glib/arrow-glib/null-data-type.cpp | 67 +++
c_glib/arrow-glib/null-data-type.h | 69 ++++
c_glib/arrow-glib/record-batch.cpp | 288 +++++++++++++
c_glib/arrow-glib/record-batch.h | 85 ++++
c_glib/arrow-glib/record-batch.hpp | 27 ++
c_glib/arrow-glib/schema.cpp | 245 +++++++++++
c_glib/arrow-glib/schema.h | 80 ++++
c_glib/arrow-glib/schema.hpp | 27 ++
c_glib/arrow-glib/string-array-builder.cpp | 97 +++++
c_glib/arrow-glib/string-array-builder.h | 74 ++++
c_glib/arrow-glib/string-array.cpp | 74 ++++
c_glib/arrow-glib/string-array.h | 71 ++++
c_glib/arrow-glib/string-data-type.cpp | 68 ++++
c_glib/arrow-glib/string-data-type.h | 69 ++++
c_glib/arrow-glib/struct-array-builder.cpp | 187 +++++++++
c_glib/arrow-glib/struct-array-builder.h | 81 ++++
c_glib/arrow-glib/struct-array.cpp | 97 +++++
c_glib/arrow-glib/struct-array.h | 73 ++++
c_glib/arrow-glib/struct-data-type.cpp | 75 ++++
c_glib/arrow-glib/struct-data-type.h | 71 ++++
c_glib/arrow-glib/table.cpp | 240 +++++++++++
c_glib/arrow-glib/table.h | 80 ++++
c_glib/arrow-glib/table.hpp | 27 ++
c_glib/arrow-glib/type.cpp | 90 +++++
c_glib/arrow-glib/type.h | 84 ++++
c_glib/arrow-glib/type.hpp | 26 ++
c_glib/arrow-glib/uint16-array-builder.cpp | 120 ++++++
c_glib/arrow-glib/uint16-array-builder.h | 76 ++++
c_glib/arrow-glib/uint16-array.cpp | 69 ++++
c_glib/arrow-glib/uint16-array.h | 71 ++++
c_glib/arrow-glib/uint16-data-type.cpp | 67 +++
c_glib/arrow-glib/uint16-data-type.h | 69 ++++
c_glib/arrow-glib/uint32-array-builder.cpp | 120 ++++++
c_glib/arrow-glib/uint32-array-builder.h | 76 ++++
c_glib/arrow-glib/uint32-array.cpp | 69 ++++
c_glib/arrow-glib/uint32-array.h | 71 ++++
c_glib/arrow-glib/uint32-data-type.cpp | 67 +++
c_glib/arrow-glib/uint32-data-type.h | 69 ++++
c_glib/arrow-glib/uint64-array-builder.cpp | 120 ++++++
c_glib/arrow-glib/uint64-array-builder.h | 76 ++++
c_glib/arrow-glib/uint64-array.cpp | 69 ++++
c_glib/arrow-glib/uint64-array.h | 71 ++++
c_glib/arrow-glib/uint64-data-type.cpp | 67 +++
c_glib/arrow-glib/uint64-data-type.h | 69 ++++
c_glib/arrow-glib/uint8-array-builder.cpp | 120 ++++++
c_glib/arrow-glib/uint8-array-builder.h | 76 ++++
c_glib/arrow-glib/uint8-array.cpp | 69 ++++
c_glib/arrow-glib/uint8-array.h | 71 ++++
c_glib/arrow-glib/uint8-data-type.cpp | 67 +++
c_glib/arrow-glib/uint8-data-type.h | 69 ++++
c_glib/autogen.sh | 31 ++
c_glib/configure.ac | 76 ++++
c_glib/doc/Makefile.am | 19 +
c_glib/doc/reference/Makefile.am | 63 +++
c_glib/doc/reference/arrow-glib-docs.sgml | 171 ++++++++
c_glib/example/Makefile.am | 34 ++
c_glib/example/build.c | 71 ++++
c_glib/test/helper/buildable.rb | 77 ++++
c_glib/test/run-test.rb | 41 ++
c_glib/test/run-test.sh | 29 ++
c_glib/test/test-array.rb | 44 ++
c_glib/test/test-binary-array.rb | 25 ++
c_glib/test/test-binary-data-type.rb | 28 ++
c_glib/test/test-boolean-array.rb | 25 ++
c_glib/test/test-boolean-data-type.rb | 28 ++
c_glib/test/test-chunked-array.rb | 67 +++
c_glib/test/test-column.rb | 86 ++++
c_glib/test/test-double-array.rb | 25 ++
c_glib/test/test-double-data-type.rb | 28 ++
c_glib/test/test-field.rb | 41 ++
c_glib/test/test-float-array.rb | 25 ++
c_glib/test/test-float-data-type.rb | 28 ++
c_glib/test/test-int16-array.rb | 25 ++
c_glib/test/test-int16-data-type.rb | 28 ++
c_glib/test/test-int32-array.rb | 25 ++
c_glib/test/test-int32-data-type.rb | 28 ++
c_glib/test/test-int64-array.rb | 25 ++
c_glib/test/test-int64-data-type.rb | 28 ++
c_glib/test/test-int8-array.rb | 25 ++
c_glib/test/test-int8-data-type.rb | 28 ++
c_glib/test/test-io-file-output-stream.rb | 38 ++
c_glib/test/test-io-memory-mapped-file.rb | 138 +++++++
c_glib/test/test-ipc-file-writer.rb | 45 +++
c_glib/test/test-ipc-stream-writer.rb | 53 +++
c_glib/test/test-list-array.rb | 43 ++
c_glib/test/test-list-data-type.rb | 36 ++
c_glib/test/test-null-array.rb | 33 ++
c_glib/test/test-null-data-type.rb | 28 ++
c_glib/test/test-record-batch.rb | 80 ++++
c_glib/test/test-schema.rb | 69 ++++
c_glib/test/test-string-array.rb | 25 ++
c_glib/test/test-string-data-type.rb | 28 ++
c_glib/test/test-struct-array.rb | 58 +++
c_glib/test/test-table.rb | 72 ++++
c_glib/test/test-uint16-array.rb | 25 ++
c_glib/test/test-uint16-data-type.rb | 28 ++
c_glib/test/test-uint32-array.rb | 25 ++
c_glib/test/test-uint32-data-type.rb | 28 ++
c_glib/test/test-uint64-array.rb | 25 ++
c_glib/test/test-uint64-data-type.rb | 28 ++
c_glib/test/test-uint8-array.rb | 25 ++
c_glib/test/test-uint8-data-type.rb | 28 ++
ci/travis_before_script_c_glib.sh | 40 ++
ci/travis_script_c_glib.sh | 24 ++
246 files changed, 18251 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index e8d9104..b219b03 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,6 +16,9 @@ addons:
- libboost-filesystem-dev
- libboost-system-dev
- libjemalloc-dev
+ - gtk-doc-tools
+ - autoconf-archive
+ - libgirepository1.0-dev
matrix:
fast_finish: true
@@ -30,9 +33,11 @@ matrix:
- export CC="gcc-4.9"
- export CXX="g++-4.9"
- $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh
+ - $TRAVIS_BUILD_DIR/ci/travis_before_script_c_glib.sh
script:
- $TRAVIS_BUILD_DIR/ci/travis_script_cpp.sh
- $TRAVIS_BUILD_DIR/ci/travis_script_python.sh
+ - $TRAVIS_BUILD_DIR/ci/travis_script_c_glib.sh
- compiler: clang
osx_image: xcode6.4
os: osx
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/.gitignore
----------------------------------------------------------------------
diff --git a/c_glib/.gitignore b/c_glib/.gitignore
new file mode 100644
index 0000000..38e33a2
--- /dev/null
+++ b/c_glib/.gitignore
@@ -0,0 +1,44 @@
+Makefile
+Makefile.in
+.deps/
+.libs/
+*.gir
+*.typelib
+*.o
+*.lo
+*.la
+*~
+/*.tar.gz
+/aclocal.m4
+/autom4te.cache/
+/config.h
+/config.h.in
+/config.log
+/config.status
+/config/
+/configure
+/doc/reference/*.txt
+/doc/reference/*.txt.bak
+/doc/reference/*.args
+/doc/reference/*.hierarchy
+/doc/reference/*.interfaces
+/doc/reference/*.prerequisites
+/doc/reference/*.signals
+/doc/reference/*.types
+/doc/reference/gtk-doc.make
+/doc/reference/*.stamp
+/doc/reference/html/
+/doc/reference/xml/
+/libtool
+/m4/
+/stamp-h1
+/version
+/arrow-glib/enums.c
+/arrow-glib/enums.h
+/arrow-glib/io-enums.c
+/arrow-glib/io-enums.h
+/arrow-glib/ipc-enums.c
+/arrow-glib/ipc-enums.h
+/arrow-glib/stamp-*
+/arrow-glib/*.pc
+/example/build
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/Makefile.am
----------------------------------------------------------------------
diff --git a/c_glib/Makefile.am b/c_glib/Makefile.am
new file mode 100644
index 0000000..076f9be
--- /dev/null
+++ b/c_glib/Makefile.am
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+
+SUBDIRS = \
+ arrow-glib \
+ doc \
+ example
+
+EXTRA_DIST = \
+ version
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/README.md
----------------------------------------------------------------------
diff --git a/c_glib/README.md b/c_glib/README.md
new file mode 100644
index 0000000..4008015
--- /dev/null
+++ b/c_glib/README.md
@@ -0,0 +1,114 @@
+<!---
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. See accompanying LICENSE file.
+-->
+
+# Arrow GLib
+
+Arrow GLib is a wrapper library for Arrow C++. Arrow GLib provides C
+API.
+
+Arrow GLib supports
+[GObject Introspection](https://wiki.gnome.org/action/show/Projects/GObjectIntrospection).
+It means that you can create language bindings at runtime or compile time.
+
+For example, you can use Apache Arrow from Ruby by Arrow GLib and
+[gobject-introspection gem](https://rubygems.org/gems/gobject-introspection)
+with the following code:
+
+```ruby
+# Generate bindings at runtime
+require "gi"
+Arrow = GI.load("Arrow")
+
+# Now, you can access arrow::BooleanArray in Arrow C++ by
+# Arrow::BooleanArray
+p Arrow::BooleanArray
+```
+
+In Ruby case, you should use
+[red-arrow gem](https://rubygems.org/gems/red-arrow). It's based on
+gobject-introspection gem. It adds many convenient features to raw
+gobject-introspection gem based bindings.
+
+## Install
+
+### Package
+
+TODO
+
+### Build
+
+You need to install Arrow C++ before you install Arrow GLib. See Arrow
+C++ document about how to install Arrow C++.
+
+You need [GTK-Doc](https://www.gtk.org/gtk-doc/) and
+[GObject Introspection](https://wiki.gnome.org/action/show/Projects/GObjectIntrospection)
+to build Arrow GLib. You can install them by the followings:
+
+On Debian GNU/Linux or Ubuntu:
+
+```text
+% sudo apt install -y -V gtk-doc-tools libgirepository1.0-dev
+```
+
+On CentOS 7 or later:
+
+```text
+% sudo yum install -y gtk-doc gobject-introspection-devel
+```
+
+On macOS with [Homebrew](https://brew.sh/):
+
+```text
+% brew install -y gtk-doc gobject-introspection
+```
+
+Now, you can build Arrow GLib:
+
+```text
+% cd glib
+% ./configure --enable-gtk-doc
+% make
+% sudo make install
+```
+
+## Usage
+
+You can use Arrow GLib with C or other languages. If you use Arrow
+GLib with C, you use C API. If you use Arrow GLib with other
+languages, you use GObject Introspection based bindings.
+
+### C
+
+You can find API reference in the
+`/usr/local/share/gtk-doc/html/arrow-glib/` directory. If you specify
+`--prefix` to `configure`, the directory will be different.
+
+You can find example codes in the `example/` directory.
+
+### Language bindings
+
+You can use Arrow GLib with non C languages with GObject Introspection
+based bindings. Here are languages that support GObject Introspection:
+
+ * Ruby: [red-arrow gem](https://rubygems.org/gems/red-arrow) should be used.
+
+ * Python: [PyGObject](https://wiki.gnome.org/Projects/PyGObject) should be used. (Note that you should use PyArrow than Arrow GLib.)
+
+ * Lua: [LGI](https://github.com/pavouk/lgi) should be used.
+
+ * Go: [Go-gir-generator](https://github.com/linuxdeepin/go-gir-generator) should be used.
+
+See also
+[Projects/GObjectIntrospection/Users - GNOME Wiki!](https://wiki.gnome.org/Projects/GObjectIntrospection/Users)
+for other languages.
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/Makefile.am
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/Makefile.am b/c_glib/arrow-glib/Makefile.am
new file mode 100644
index 0000000..61137a0
--- /dev/null
+++ b/c_glib/arrow-glib/Makefile.am
@@ -0,0 +1,494 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+CLEANFILES =
+
+EXTRA_DIST =
+
+AM_CPPFLAGS = \
+ -I$(top_builddir) \
+ -I$(top_srcdir)
+
+AM_CFLAGS = \
+ $(GLIB_CFLAGS) \
+ $(GARROW_CFLAGS)
+
+# libarrow-glib
+lib_LTLIBRARIES = \
+ libarrow-glib.la
+
+libarrow_glib_la_CXXFLAGS = \
+ $(GLIB_CFLAGS) \
+ $(ARROW_CFLAGS) \
+ $(GARROW_CXXFLAGS)
+
+libarrow_glib_la_LIBADD = \
+ $(GLIB_LIBS) \
+ $(ARROW_LIBS)
+
+libarrow_glib_la_headers = \
+ array.h \
+ array-builder.h \
+ arrow-glib.h \
+ chunked-array.h \
+ column.h \
+ binary-array.h \
+ binary-array-builder.h \
+ binary-data-type.h \
+ boolean-array.h \
+ boolean-array-builder.h \
+ boolean-data-type.h \
+ data-type.h \
+ double-array.h \
+ double-array-builder.h \
+ double-data-type.h \
+ error.h \
+ field.h \
+ float-array.h \
+ float-array-builder.h \
+ float-data-type.h \
+ int8-array.h \
+ int8-array-builder.h \
+ int8-data-type.h \
+ int16-array.h \
+ int16-array-builder.h \
+ int16-data-type.h \
+ int32-array.h \
+ int32-array-builder.h \
+ int32-data-type.h \
+ int64-array.h \
+ int64-array-builder.h \
+ int64-data-type.h \
+ list-array.h \
+ list-array-builder.h \
+ list-data-type.h \
+ null-array.h \
+ null-data-type.h \
+ record-batch.h \
+ schema.h \
+ string-array.h \
+ string-array-builder.h \
+ string-data-type.h \
+ struct-array.h \
+ struct-array-builder.h \
+ struct-data-type.h \
+ table.h \
+ type.h \
+ uint8-array.h \
+ uint8-array-builder.h \
+ uint8-data-type.h \
+ uint16-array.h \
+ uint16-array-builder.h \
+ uint16-data-type.h \
+ uint32-array.h \
+ uint32-array-builder.h \
+ uint32-data-type.h \
+ uint64-array.h \
+ uint64-array-builder.h \
+ uint64-data-type.h
+
+libarrow_glib_la_generated_headers = \
+ enums.h
+
+libarrow_glib_la_generated_sources = \
+ enums.c \
+ $(libarrow_glib_la_generated_headers)
+
+libarrow_glib_la_sources = \
+ array.cpp \
+ array-builder.cpp \
+ binary-array.cpp \
+ binary-array-builder.cpp \
+ binary-data-type.cpp \
+ boolean-array.cpp \
+ boolean-array-builder.cpp \
+ boolean-data-type.cpp \
+ chunked-array.cpp \
+ column.cpp \
+ data-type.cpp \
+ double-array.cpp \
+ double-array-builder.cpp \
+ double-data-type.cpp \
+ error.cpp \
+ field.cpp \
+ float-array.cpp \
+ float-array-builder.cpp \
+ float-data-type.cpp \
+ int8-array.cpp \
+ int8-array-builder.cpp \
+ int8-data-type.cpp \
+ int16-array.cpp \
+ int16-array-builder.cpp \
+ int16-data-type.cpp \
+ int32-array.cpp \
+ int32-array-builder.cpp \
+ int32-data-type.cpp \
+ int64-array.cpp \
+ int64-array-builder.cpp \
+ int64-data-type.cpp \
+ list-array.cpp \
+ list-array-builder.cpp \
+ list-data-type.cpp \
+ null-array.cpp \
+ null-data-type.cpp \
+ record-batch.cpp \
+ schema.cpp \
+ string-array.cpp \
+ string-array-builder.cpp \
+ string-data-type.cpp \
+ struct-array.cpp \
+ struct-array-builder.cpp \
+ struct-data-type.cpp \
+ table.cpp \
+ type.cpp \
+ uint8-array.cpp \
+ uint8-array-builder.cpp \
+ uint8-data-type.cpp \
+ uint16-array.cpp \
+ uint16-array-builder.cpp \
+ uint16-data-type.cpp \
+ uint32-array.cpp \
+ uint32-array-builder.cpp \
+ uint32-data-type.cpp \
+ uint64-array.cpp \
+ uint64-array-builder.cpp \
+ uint64-data-type.cpp \
+ $(libarrow_glib_la_headers) \
+ $(libarrow_glib_la_generated_sources)
+
+libarrow_glib_la_cpp_headers = \
+ array.hpp \
+ array-builder.hpp \
+ arrow-glib.hpp \
+ chunked-array.hpp \
+ column.hpp \
+ data-type.hpp \
+ error.hpp \
+ field.hpp \
+ record-batch.hpp \
+ schema.hpp \
+ table.hpp \
+ type.hpp
+
+libarrow_glib_la_SOURCES = \
+ $(libarrow_glib_la_sources) \
+ $(libarrow_glib_la_cpp_headers)
+
+BUILT_SOURCES = \
+ $(libarrow_glib_la_genearted_sources) \
+ stamp-enums.c \
+ stamp-enums.h
+
+EXTRA_DIST += \
+ enums.c.template \
+ enums.h.template
+
+enums.h: stamp-enums.h
+ @true
+stamp-enums.h: $(libarrow_glib_la_headers) enums.h.template
+ $(AM_V_GEN) \
+ (cd $(srcdir) && \
+ $(GLIB_MKENUMS) \
+ --identifier-prefix GArrow \
+ --symbol-prefix garrow \
+ --template enums.h.template \
+ $(libarrow_glib_la_headers)) > enums.h
+ touch $@
+
+enums.c: stamp-enums.c
+ @true
+stamp-enums.c: $(libarrow_glib_la_headers) enums.c.template
+ $(AM_V_GEN) \
+ (cd $(srcdir) && \
+ $(GLIB_MKENUMS) \
+ --identifier-prefix GArrow \
+ --symbol-prefix garrow \
+ --template enums.c.template \
+ $(libarrow_glib_la_headers)) > enums.c
+ touch $@
+
+# libarrow-io-glib
+lib_LTLIBRARIES += \
+ libarrow-io-glib.la
+
+libarrow_io_glib_la_CXXFLAGS = \
+ $(GLIB_CFLAGS) \
+ $(ARROW_IO_CFLAGS) \
+ $(GARROW_CXXFLAGS)
+
+libarrow_io_glib_la_LIBADD = \
+ $(GLIB_LIBS) \
+ $(ARROW_IO_LIBS)
+
+libarrow_io_glib_la_headers = \
+ arrow-io-glib.h \
+ io-file.h \
+ io-file-mode.h \
+ io-file-output-stream.h \
+ io-input-stream.h \
+ io-memory-mapped-file.h \
+ io-output-stream.h \
+ io-readable.h \
+ io-readable-file.h \
+ io-writeable.h \
+ io-writeable-file.h
+
+libarrow_io_glib_la_generated_headers = \
+ io-enums.h
+
+libarrow_io_glib_la_generated_sources = \
+ io-enums.c \
+ $(libarrow_io_glib_la_generated_headers)
+
+libarrow_io_glib_la_sources = \
+ io-file.cpp \
+ io-file-mode.cpp \
+ io-file-output-stream.cpp \
+ io-input-stream.cpp \
+ io-memory-mapped-file.cpp \
+ io-output-stream.cpp \
+ io-readable.cpp \
+ io-readable-file.cpp \
+ io-writeable.cpp \
+ io-writeable-file.cpp \
+ $(libarrow_io_glib_la_headers) \
+ $(libarrow_io_glib_la_generated_sources)
+
+libarrow_io_glib_la_cpp_headers = \
+ arrow-io-glib.hpp \
+ io-file.hpp \
+ io-file-mode.hpp \
+ io-file-output-stream.hpp \
+ io-input-stream.hpp \
+ io-memory-mapped-file.hpp \
+ io-output-stream.hpp \
+ io-readable.hpp \
+ io-readable-file.hpp \
+ io-writeable.hpp \
+ io-writeable-file.hpp
+
+libarrow_io_glib_la_SOURCES = \
+ $(libarrow_io_glib_la_sources) \
+ $(libarrow_io_glib_la_cpp_headers)
+
+BUILT_SOURCES += \
+ $(libarrow_io_glib_la_genearted_sources) \
+ stamp-io-enums.c \
+ stamp-io-enums.h
+
+EXTRA_DIST += \
+ io-enums.c.template \
+ io-enums.h.template
+
+io-enums.h: stamp-io-enums.h
+ @true
+stamp-io-enums.h: $(libarrow_io_glib_la_headers) io-enums.h.template
+ $(AM_V_GEN) \
+ (cd $(srcdir) && \
+ $(GLIB_MKENUMS) \
+ --identifier-prefix GArrowIO \
+ --symbol-prefix garrow_io \
+ --template io-enums.h.template \
+ $(libarrow_io_glib_la_headers)) > io-enums.h
+ touch $@
+
+io-enums.c: stamp-io-enums.c
+ @true
+stamp-io-enums.c: $(libarrow_io_glib_la_headers) io-enums.c.template
+ $(AM_V_GEN) \
+ (cd $(srcdir) && \
+ $(GLIB_MKENUMS) \
+ --identifier-prefix GArrowIO \
+ --symbol-prefix garrow_io \
+ --template io-enums.c.template \
+ $(libarrow_io_glib_la_headers)) > io-enums.c
+ touch $@
+
+# libarrow-ipc-glib
+lib_LTLIBRARIES += \
+ libarrow-ipc-glib.la
+
+libarrow_ipc_glib_la_CXXFLAGS = \
+ $(GLIB_CFLAGS) \
+ $(ARROW_IPC_CFLAGS) \
+ $(GARROW_CXXFLAGS)
+
+libarrow_ipc_glib_la_LIBADD = \
+ $(GLIB_LIBS) \
+ $(ARROW_IPC_LIBS)
+
+libarrow_ipc_glib_la_headers = \
+ arrow-ipc-glib.h \
+ ipc-file-reader.h \
+ ipc-file-writer.h \
+ ipc-stream-reader.h \
+ ipc-stream-writer.h \
+ ipc-metadata-version.h
+
+libarrow_ipc_glib_la_generated_headers = \
+ ipc-enums.h
+
+libarrow_ipc_glib_la_generated_sources = \
+ ipc-enums.c \
+ $(libarrow_ipc_glib_la_generated_headers)
+
+libarrow_ipc_glib_la_sources = \
+ ipc-file-reader.cpp \
+ ipc-file-writer.cpp \
+ ipc-metadata-version.cpp \
+ ipc-stream-reader.cpp \
+ ipc-stream-writer.cpp \
+ $(libarrow_ipc_glib_la_headers) \
+ $(libarrow_ipc_glib_la_generated_sources)
+
+libarrow_ipc_glib_la_cpp_headers = \
+ arrow-ipc-glib.hpp \
+ ipc-file-reader.hpp \
+ ipc-file-writer.hpp \
+ ipc-metadata-version.hpp \
+ ipc-stream-reader.hpp \
+ ipc-stream-writer.hpp
+
+libarrow_ipc_glib_la_SOURCES = \
+ $(libarrow_ipc_glib_la_sources) \
+ $(libarrow_ipc_glib_la_cpp_headers)
+
+BUILT_SOURCES += \
+ $(libarrow_ipc_glib_la_genearted_sources) \
+ stamp-ipc-enums.c \
+ stamp-ipc-enums.h
+
+EXTRA_DIST += \
+ ipc-enums.c.template \
+ ipc-enums.h.template
+
+ipc-enums.h: stamp-ipc-enums.h
+ @true
+stamp-ipc-enums.h: $(libarrow_ipc_glib_la_headers) ipc-enums.h.template
+ $(AM_V_GEN) \
+ (cd $(srcdir) && \
+ $(GLIB_MKENUMS) \
+ --identifier-prefix GArrowIPC \
+ --symbol-prefix garrow_ipc \
+ --template ipc-enums.h.template \
+ $(libarrow_ipc_glib_la_headers)) > ipc-enums.h
+ touch $@
+
+ipc-enums.c: stamp-ipc-enums.c
+ @true
+stamp-ipc-enums.c: $(libarrow_ipc_glib_la_headers) ipc-enums.c.template
+ $(AM_V_GEN) \
+ (cd $(srcdir) && \
+ $(GLIB_MKENUMS) \
+ --identifier-prefix GArrowIPC \
+ --symbol-prefix garrow_ipc \
+ --template ipc-enums.c.template \
+ $(libarrow_ipc_glib_la_headers)) > ipc-enums.c
+ touch $@
+
+pkginclude_HEADERS = \
+ $(libarrow_glib_la_headers) \
+ $(libarrow_glib_la_cpp_headers) \
+ $(libarrow_glib_la_generated_headers) \
+ $(libarrow_io_glib_la_headers) \
+ $(libarrow_io_glib_la_cpp_headers) \
+ $(libarrow_io_glib_la_generated_headers) \
+ $(libarrow_ipc_glib_la_headers) \
+ $(libarrow_ipc_glib_la_cpp_headers) \
+ $(libarrow_ipc_glib_la_generated_headers)
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = \
+ arrow-glib.pc \
+ arrow-io-glib.pc \
+ arrow-ipc-glib.pc
+
+# GObject Introspection
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS =
+INTROSPECTION_COMPILER_ARGS =
+
+if HAVE_INTROSPECTION
+Arrow-1.0.gir: libarrow-glib.la
+Arrow_1_0_gir_PACKAGES = \
+ gobject-2.0
+Arrow_1_0_gir_EXPORT_PACKAGES = arrow
+Arrow_1_0_gir_INCLUDES = GObject-2.0
+Arrow_1_0_gir_CFLAGS = \
+ $(AM_CPPFLAGS)
+Arrow_1_0_gir_LIBS = libarrow-glib.la
+Arrow_1_0_gir_FILES = $(libarrow_glib_la_sources)
+Arrow_1_0_gir_SCANNERFLAGS = \
+ --warn-all \
+ --identifier-prefix=GArrow \
+ --symbol-prefix=garrow
+INTROSPECTION_GIRS += Arrow-1.0.gir
+
+ArrowIO-1.0.gir: libarrow-io-glib.la
+ArrowIO-1.0.gir: Arrow-1.0.gir
+ArrowIO_1_0_gir_PACKAGES = \
+ gobject-2.0
+ArrowIO_1_0_gir_EXPORT_PACKAGES = arrow-io
+ArrowIO_1_0_gir_INCLUDES = \
+ GObject-2.0
+ArrowIO_1_0_gir_CFLAGS = \
+ $(AM_CPPFLAGS)
+ArrowIO_1_0_gir_LIBS = \
+ libarrow-io-glib.la \
+ libarrow-glib.la
+ArrowIO_1_0_gir_FILES = $(libarrow_io_glib_la_sources)
+ArrowIO_1_0_gir_SCANNERFLAGS = \
+ --include-uninstalled=$(builddir)/Arrow-1.0.gir \
+ --warn-all \
+ --identifier-prefix=GArrowIO \
+ --symbol-prefix=garrow_io
+INTROSPECTION_GIRS += ArrowIO-1.0.gir
+
+ArrowIPC-1.0.gir: libarrow-ipc-glib.la
+ArrowIPC-1.0.gir: Arrow-1.0.gir
+ArrowIPC-1.0.gir: ArrowIO-1.0.gir
+ArrowIPC_1_0_gir_PACKAGES = \
+ gobject-2.0
+ArrowIPC_1_0_gir_EXPORT_PACKAGES = arrow-ipc
+ArrowIPC_1_0_gir_INCLUDES = \
+ GObject-2.0
+ArrowIPC_1_0_gir_CFLAGS = \
+ $(AM_CPPFLAGS)
+ArrowIPC_1_0_gir_LIBS = \
+ libarrow-ipc-glib.la \
+ libarrow-io-glib.la \
+ libarrow-glib.la
+ArrowIPC_1_0_gir_FILES = $(libarrow_ipc_glib_la_sources)
+ArrowIPC_1_0_gir_SCANNERFLAGS = \
+ --include-uninstalled=$(builddir)/Arrow-1.0.gir \
+ --include-uninstalled=$(builddir)/ArrowIO-1.0.gir \
+ --warn-all \
+ --identifier-prefix=GArrowIPC \
+ --symbol-prefix=garrow_ipc
+INTROSPECTION_GIRS += ArrowIPC-1.0.gir
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+CLEANFILES += \
+ $(gir_DATA) \
+ $(typelib_DATA)
+endif
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/array-builder.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/array-builder.cpp b/c_glib/arrow-glib/array-builder.cpp
new file mode 100644
index 0000000..0f038c8
--- /dev/null
+++ b/c_glib/arrow-glib/array-builder.cpp
@@ -0,0 +1,229 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <arrow-glib/array-builder.hpp>
+#include <arrow-glib/binary-array-builder.h>
+#include <arrow-glib/boolean-array-builder.h>
+#include <arrow-glib/double-array-builder.h>
+#include <arrow-glib/float-array-builder.h>
+#include <arrow-glib/int8-array-builder.h>
+#include <arrow-glib/int16-array-builder.h>
+#include <arrow-glib/int32-array-builder.h>
+#include <arrow-glib/int64-array-builder.h>
+#include <arrow-glib/list-array-builder.h>
+#include <arrow-glib/string-array-builder.h>
+#include <arrow-glib/struct-array-builder.h>
+#include <arrow-glib/uint8-array-builder.h>
+#include <arrow-glib/uint16-array-builder.h>
+#include <arrow-glib/uint32-array-builder.h>
+#include <arrow-glib/uint64-array-builder.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: array-builder
+ * @short_description: Base class for all array builder classes.
+ *
+ * #GArrowArrayBuilder is a base class for all array builder classes
+ * such as #GArrowBooleanArrayBuilder.
+ *
+ * You need to use array builder class to create a new array.
+ */
+
+typedef struct GArrowArrayBuilderPrivate_ {
+ std::shared_ptr<arrow::ArrayBuilder> array_builder;
+} GArrowArrayBuilderPrivate;
+
+enum {
+ PROP_0,
+ PROP_ARRAY_BUILDER
+};
+
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(GArrowArrayBuilder,
+ garrow_array_builder,
+ G_TYPE_OBJECT)
+
+#define GARROW_ARRAY_BUILDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE((obj), \
+ GARROW_TYPE_ARRAY_BUILDER, \
+ GArrowArrayBuilderPrivate))
+
+static void
+garrow_array_builder_finalize(GObject *object)
+{
+ GArrowArrayBuilderPrivate *priv;
+
+ priv = GARROW_ARRAY_BUILDER_GET_PRIVATE(object);
+
+ priv->array_builder = nullptr;
+
+ G_OBJECT_CLASS(garrow_array_builder_parent_class)->finalize(object);
+}
+
+static void
+garrow_array_builder_set_property(GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GArrowArrayBuilderPrivate *priv;
+
+ priv = GARROW_ARRAY_BUILDER_GET_PRIVATE(object);
+
+ switch (prop_id) {
+ case PROP_ARRAY_BUILDER:
+ priv->array_builder =
+ *static_cast<std::shared_ptr<arrow::ArrayBuilder> *>(g_value_get_pointer(value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+garrow_array_builder_get_property(GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+garrow_array_builder_init(GArrowArrayBuilder *builder)
+{
+}
+
+static void
+garrow_array_builder_class_init(GArrowArrayBuilderClass *klass)
+{
+ GObjectClass *gobject_class;
+ GParamSpec *spec;
+
+ gobject_class = G_OBJECT_CLASS(klass);
+
+ gobject_class->finalize = garrow_array_builder_finalize;
+ gobject_class->set_property = garrow_array_builder_set_property;
+ gobject_class->get_property = garrow_array_builder_get_property;
+
+ spec = g_param_spec_pointer("array-builder",
+ "Array builder",
+ "The raw std::shared<arrow::ArrayBuilder> *",
+ static_cast<GParamFlags>(G_PARAM_WRITABLE |
+ G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property(gobject_class, PROP_ARRAY_BUILDER, spec);
+}
+
+/**
+ * garrow_array_builder_finish:
+ * @builder: A #GArrowArrayBuilder.
+ *
+ * Returns: (transfer full): The built #GArrowArray.
+ */
+GArrowArray *
+garrow_array_builder_finish(GArrowArrayBuilder *builder)
+{
+ auto arrow_builder = garrow_array_builder_get_raw(builder);
+ std::shared_ptr<arrow::Array> arrow_array;
+ arrow_builder->Finish(&arrow_array);
+ return garrow_array_new_raw(&arrow_array);
+}
+
+G_END_DECLS
+
+GArrowArrayBuilder *
+garrow_array_builder_new_raw(std::shared_ptr<arrow::ArrayBuilder> *arrow_builder)
+{
+ GType type;
+
+ switch ((*arrow_builder)->type()->type) {
+ case arrow::Type::type::BOOL:
+ type = GARROW_TYPE_BOOLEAN_ARRAY_BUILDER;
+ break;
+ case arrow::Type::type::UINT8:
+ type = GARROW_TYPE_UINT8_ARRAY_BUILDER;
+ break;
+ case arrow::Type::type::INT8:
+ type = GARROW_TYPE_INT8_ARRAY_BUILDER;
+ break;
+ case arrow::Type::type::UINT16:
+ type = GARROW_TYPE_UINT16_ARRAY_BUILDER;
+ break;
+ case arrow::Type::type::INT16:
+ type = GARROW_TYPE_INT16_ARRAY_BUILDER;
+ break;
+ case arrow::Type::type::UINT32:
+ type = GARROW_TYPE_UINT32_ARRAY_BUILDER;
+ break;
+ case arrow::Type::type::INT32:
+ type = GARROW_TYPE_INT32_ARRAY_BUILDER;
+ break;
+ case arrow::Type::type::UINT64:
+ type = GARROW_TYPE_UINT64_ARRAY_BUILDER;
+ break;
+ case arrow::Type::type::INT64:
+ type = GARROW_TYPE_INT64_ARRAY_BUILDER;
+ break;
+ case arrow::Type::type::FLOAT:
+ type = GARROW_TYPE_FLOAT_ARRAY_BUILDER;
+ break;
+ case arrow::Type::type::DOUBLE:
+ type = GARROW_TYPE_DOUBLE_ARRAY_BUILDER;
+ break;
+ case arrow::Type::type::BINARY:
+ type = GARROW_TYPE_BINARY_ARRAY_BUILDER;
+ break;
+ case arrow::Type::type::STRING:
+ type = GARROW_TYPE_STRING_ARRAY_BUILDER;
+ break;
+ case arrow::Type::type::LIST:
+ type = GARROW_TYPE_LIST_ARRAY_BUILDER;
+ break;
+ case arrow::Type::type::STRUCT:
+ type = GARROW_TYPE_STRUCT_ARRAY_BUILDER;
+ break;
+ default:
+ type = GARROW_TYPE_ARRAY_BUILDER;
+ break;
+ }
+
+ auto builder =
+ GARROW_ARRAY_BUILDER(g_object_new(type,
+ "array-builder", arrow_builder,
+ NULL));
+ return builder;
+}
+
+std::shared_ptr<arrow::ArrayBuilder>
+garrow_array_builder_get_raw(GArrowArrayBuilder *builder)
+{
+ GArrowArrayBuilderPrivate *priv;
+
+ priv = GARROW_ARRAY_BUILDER_GET_PRIVATE(builder);
+ return priv->array_builder;
+}
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/array-builder.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/array-builder.h b/c_glib/arrow-glib/array-builder.h
new file mode 100644
index 0000000..3717aef
--- /dev/null
+++ b/c_glib/arrow-glib/array-builder.h
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <arrow-glib/array.h>
+
+G_BEGIN_DECLS
+
+#define GARROW_TYPE_ARRAY_BUILDER \
+ (garrow_array_builder_get_type())
+#define GARROW_ARRAY_BUILDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+ GARROW_TYPE_ARRAY_BUILDER, \
+ GArrowArrayBuilder))
+#define GARROW_ARRAY_BUILDER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), \
+ GARROW_TYPE_ARRAY_BUILDER, \
+ GArrowArrayBuilderClass))
+#define GARROW_IS_ARRAY_BUILDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+ GARROW_TYPE_ARRAY_BUILDER))
+#define GARROW_IS_ARRAY_BUILDER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass), \
+ GARROW_TYPE_ARRAY_BUILDER))
+#define GARROW_ARRAY_BUILDER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS((obj), \
+ GARROW_TYPE_ARRAY_BUILDER, \
+ GArrowArrayBuilderClass))
+
+typedef struct _GArrowArrayBuilder GArrowArrayBuilder;
+typedef struct _GArrowArrayBuilderClass GArrowArrayBuilderClass;
+
+/**
+ * GArrowArrayBuilder:
+ *
+ * It wraps `arrow::ArrayBuilder`.
+ */
+struct _GArrowArrayBuilder
+{
+ /*< private >*/
+ GObject parent_instance;
+};
+
+struct _GArrowArrayBuilderClass
+{
+ GObjectClass parent_class;
+};
+
+GType garrow_array_builder_get_type (void) G_GNUC_CONST;
+
+GArrowArray *garrow_array_builder_finish (GArrowArrayBuilder *builder);
+
+G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/array-builder.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/array-builder.hpp b/c_glib/arrow-glib/array-builder.hpp
new file mode 100644
index 0000000..becebb2
--- /dev/null
+++ b/c_glib/arrow-glib/array-builder.hpp
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <arrow-glib/array.hpp>
+#include <arrow-glib/array-builder.h>
+
+GArrowArrayBuilder *garrow_array_builder_new_raw(std::shared_ptr<arrow::ArrayBuilder> *arrow_builder);
+std::shared_ptr<arrow::ArrayBuilder> garrow_array_builder_get_raw(GArrowArrayBuilder *builder);
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/array.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/array.cpp b/c_glib/arrow-glib/array.cpp
new file mode 100644
index 0000000..5dacb07
--- /dev/null
+++ b/c_glib/arrow-glib/array.cpp
@@ -0,0 +1,268 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <arrow-glib/array.hpp>
+#include <arrow-glib/binary-array.h>
+#include <arrow-glib/boolean-array.h>
+#include <arrow-glib/double-array.h>
+#include <arrow-glib/float-array.h>
+#include <arrow-glib/int8-array.h>
+#include <arrow-glib/int16-array.h>
+#include <arrow-glib/int32-array.h>
+#include <arrow-glib/int64-array.h>
+#include <arrow-glib/list-array.h>
+#include <arrow-glib/null-array.h>
+#include <arrow-glib/string-array.h>
+#include <arrow-glib/struct-array.h>
+#include <arrow-glib/uint8-array.h>
+#include <arrow-glib/uint16-array.h>
+#include <arrow-glib/uint32-array.h>
+#include <arrow-glib/uint64-array.h>
+
+#include <iostream>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: array
+ * @short_description: Base class for all array classes
+ *
+ * #GArrowArray is a base class for all array classes such as
+ * #GArrowBooleanArray.
+ *
+ * Array is immutable. You need to use array builder class such as
+ * #GArrowBooleanArrayBuilder to create a new array.
+ */
+
+typedef struct GArrowArrayPrivate_ {
+ std::shared_ptr<arrow::Array> array;
+} GArrowArrayPrivate;
+
+enum {
+ PROP_0,
+ PROP_ARRAY
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE(GArrowArray, garrow_array, G_TYPE_OBJECT)
+
+#define GARROW_ARRAY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE((obj), GARROW_TYPE_ARRAY, GArrowArrayPrivate))
+
+static void
+garrow_array_finalize(GObject *object)
+{
+ auto priv = GARROW_ARRAY_GET_PRIVATE(object);
+
+ priv->array = nullptr;
+
+ G_OBJECT_CLASS(garrow_array_parent_class)->finalize(object);
+}
+
+static void
+garrow_array_set_property(GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ auto priv = GARROW_ARRAY_GET_PRIVATE(object);
+
+ switch (prop_id) {
+ case PROP_ARRAY:
+ priv->array =
+ *static_cast<std::shared_ptr<arrow::Array> *>(g_value_get_pointer(value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+garrow_array_get_property(GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+garrow_array_init(GArrowArray *object)
+{
+}
+
+static void
+garrow_array_class_init(GArrowArrayClass *klass)
+{
+ GParamSpec *spec;
+
+ auto gobject_class = G_OBJECT_CLASS(klass);
+
+ gobject_class->finalize = garrow_array_finalize;
+ gobject_class->set_property = garrow_array_set_property;
+ gobject_class->get_property = garrow_array_get_property;
+
+ spec = g_param_spec_pointer("array",
+ "Array",
+ "The raw std::shared<arrow::Array> *",
+ static_cast<GParamFlags>(G_PARAM_WRITABLE |
+ G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property(gobject_class, PROP_ARRAY, spec);
+}
+
+/**
+ * garrow_array_get_length:
+ * @array: A #GArrowArray.
+ *
+ * Returns: The number of rows in the array.
+ */
+gint64
+garrow_array_get_length(GArrowArray *array)
+{
+ auto arrow_array = garrow_array_get_raw(array);
+ return arrow_array->length();
+}
+
+/**
+ * garrow_array_get_offset:
+ * @array: A #GArrowArray.
+ *
+ * Returns: The number of values in the array.
+ */
+gint64
+garrow_array_get_offset(GArrowArray *array)
+{
+ auto arrow_array = garrow_array_get_raw(array);
+ return arrow_array->offset();
+}
+
+/**
+ * garrow_array_get_n_nulls:
+ * @array: A #GArrowArray.
+ *
+ * Returns: The number of NULLs in the array.
+ */
+gint64
+garrow_array_get_n_nulls(GArrowArray *array)
+{
+ auto arrow_array = garrow_array_get_raw(array);
+ return arrow_array->null_count();
+}
+
+/**
+ * garrow_array_slice:
+ * @array: A #GArrowArray.
+ * @offset: The offset of sub #GArrowArray.
+ * @length: The length of sub #GArrowArray.
+ *
+ * Returns: (transfer full): The sub #GArrowArray. It covers only from
+ * `offset` to `offset + length` range. The sub #GArrowArray shares
+ * values with the base #GArrowArray.
+ */
+GArrowArray *
+garrow_array_slice(GArrowArray *array,
+ gint64 offset,
+ gint64 length)
+{
+ const auto arrow_array = garrow_array_get_raw(array);
+ auto arrow_sub_array = arrow_array->Slice(offset, length);
+ return garrow_array_new_raw(&arrow_sub_array);
+}
+
+G_END_DECLS
+
+GArrowArray *
+garrow_array_new_raw(std::shared_ptr<arrow::Array> *arrow_array)
+{
+ GType type;
+ GArrowArray *array;
+
+ switch ((*arrow_array)->type_enum()) {
+ case arrow::Type::type::NA:
+ type = GARROW_TYPE_NULL_ARRAY;
+ break;
+ case arrow::Type::type::BOOL:
+ type = GARROW_TYPE_BOOLEAN_ARRAY;
+ break;
+ case arrow::Type::type::UINT8:
+ type = GARROW_TYPE_UINT8_ARRAY;
+ break;
+ case arrow::Type::type::INT8:
+ type = GARROW_TYPE_INT8_ARRAY;
+ break;
+ case arrow::Type::type::UINT16:
+ type = GARROW_TYPE_UINT16_ARRAY;
+ break;
+ case arrow::Type::type::INT16:
+ type = GARROW_TYPE_INT16_ARRAY;
+ break;
+ case arrow::Type::type::UINT32:
+ type = GARROW_TYPE_UINT32_ARRAY;
+ break;
+ case arrow::Type::type::INT32:
+ type = GARROW_TYPE_INT32_ARRAY;
+ break;
+ case arrow::Type::type::UINT64:
+ type = GARROW_TYPE_UINT64_ARRAY;
+ break;
+ case arrow::Type::type::INT64:
+ type = GARROW_TYPE_INT64_ARRAY;
+ break;
+ case arrow::Type::type::FLOAT:
+ type = GARROW_TYPE_FLOAT_ARRAY;
+ break;
+ case arrow::Type::type::DOUBLE:
+ type = GARROW_TYPE_DOUBLE_ARRAY;
+ break;
+ case arrow::Type::type::BINARY:
+ type = GARROW_TYPE_BINARY_ARRAY;
+ break;
+ case arrow::Type::type::STRING:
+ type = GARROW_TYPE_STRING_ARRAY;
+ break;
+ case arrow::Type::type::LIST:
+ type = GARROW_TYPE_LIST_ARRAY;
+ break;
+ case arrow::Type::type::STRUCT:
+ type = GARROW_TYPE_STRUCT_ARRAY;
+ break;
+ default:
+ type = GARROW_TYPE_ARRAY;
+ break;
+ }
+ array = GARROW_ARRAY(g_object_new(type,
+ "array", arrow_array,
+ NULL));
+ return array;
+}
+
+std::shared_ptr<arrow::Array>
+garrow_array_get_raw(GArrowArray *array)
+{
+ auto priv = GARROW_ARRAY_GET_PRIVATE(array);
+ return priv->array;
+}
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/array.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/array.h b/c_glib/arrow-glib/array.h
new file mode 100644
index 0000000..9b1fa7e
--- /dev/null
+++ b/c_glib/arrow-glib/array.h
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define GARROW_TYPE_ARRAY \
+ (garrow_array_get_type())
+#define GARROW_ARRAY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), GARROW_TYPE_ARRAY, GArrowArray))
+#define GARROW_ARRAY_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), GARROW_TYPE_ARRAY, GArrowArrayClass))
+#define GARROW_IS_ARRAY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GARROW_TYPE_ARRAY))
+#define GARROW_IS_ARRAY_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass), GARROW_TYPE_ARRAY))
+#define GARROW_ARRAY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS((obj), GARROW_TYPE_ARRAY, GArrowArrayClass))
+
+typedef struct _GArrowArray GArrowArray;
+typedef struct _GArrowArrayClass GArrowArrayClass;
+
+/**
+ * GArrowArray:
+ *
+ * It wraps `arrow::Array`.
+ */
+struct _GArrowArray
+{
+ /*< private >*/
+ GObject parent_instance;
+};
+
+struct _GArrowArrayClass
+{
+ GObjectClass parent_class;
+};
+
+GType garrow_array_get_type (void) G_GNUC_CONST;
+
+gint64 garrow_array_get_length (GArrowArray *array);
+gint64 garrow_array_get_offset (GArrowArray *array);
+gint64 garrow_array_get_n_nulls (GArrowArray *array);
+GArrowArray *garrow_array_slice (GArrowArray *array,
+ gint64 offset,
+ gint64 length);
+
+G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/array.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/array.hpp b/c_glib/arrow-glib/array.hpp
new file mode 100644
index 0000000..d2dff22
--- /dev/null
+++ b/c_glib/arrow-glib/array.hpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <arrow/api.h>
+
+#include <arrow-glib/array.h>
+
+GArrowArray *garrow_array_new_raw(std::shared_ptr<arrow::Array> *arrow_array);
+std::shared_ptr<arrow::Array> garrow_array_get_raw(GArrowArray *array);
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/arrow-glib.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/arrow-glib.h b/c_glib/arrow-glib/arrow-glib.h
new file mode 100644
index 0000000..4356234
--- /dev/null
+++ b/c_glib/arrow-glib/arrow-glib.h
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <arrow-glib/array.h>
+#include <arrow-glib/array-builder.h>
+#include <arrow-glib/binary-array.h>
+#include <arrow-glib/binary-array-builder.h>
+#include <arrow-glib/binary-data-type.h>
+#include <arrow-glib/boolean-array.h>
+#include <arrow-glib/boolean-array-builder.h>
+#include <arrow-glib/boolean-data-type.h>
+#include <arrow-glib/chunked-array.h>
+#include <arrow-glib/column.h>
+#include <arrow-glib/data-type.h>
+#include <arrow-glib/double-array.h>
+#include <arrow-glib/double-array-builder.h>
+#include <arrow-glib/double-data-type.h>
+#include <arrow-glib/enums.h>
+#include <arrow-glib/error.h>
+#include <arrow-glib/field.h>
+#include <arrow-glib/float-array.h>
+#include <arrow-glib/float-array-builder.h>
+#include <arrow-glib/float-data-type.h>
+#include <arrow-glib/int8-array.h>
+#include <arrow-glib/int8-array-builder.h>
+#include <arrow-glib/int8-data-type.h>
+#include <arrow-glib/int16-array.h>
+#include <arrow-glib/int16-array-builder.h>
+#include <arrow-glib/int16-data-type.h>
+#include <arrow-glib/int32-array.h>
+#include <arrow-glib/int32-array-builder.h>
+#include <arrow-glib/int32-data-type.h>
+#include <arrow-glib/int64-array.h>
+#include <arrow-glib/int64-array-builder.h>
+#include <arrow-glib/int64-data-type.h>
+#include <arrow-glib/list-array.h>
+#include <arrow-glib/list-array-builder.h>
+#include <arrow-glib/list-data-type.h>
+#include <arrow-glib/null-array.h>
+#include <arrow-glib/null-data-type.h>
+#include <arrow-glib/record-batch.h>
+#include <arrow-glib/schema.h>
+#include <arrow-glib/string-array.h>
+#include <arrow-glib/string-array-builder.h>
+#include <arrow-glib/string-data-type.h>
+#include <arrow-glib/struct-array.h>
+#include <arrow-glib/struct-array-builder.h>
+#include <arrow-glib/struct-data-type.h>
+#include <arrow-glib/table.h>
+#include <arrow-glib/type.h>
+#include <arrow-glib/uint8-array.h>
+#include <arrow-glib/uint8-array-builder.h>
+#include <arrow-glib/uint8-data-type.h>
+#include <arrow-glib/uint16-array.h>
+#include <arrow-glib/uint16-array-builder.h>
+#include <arrow-glib/uint16-data-type.h>
+#include <arrow-glib/uint32-array.h>
+#include <arrow-glib/uint32-array-builder.h>
+#include <arrow-glib/uint32-data-type.h>
+#include <arrow-glib/uint64-array.h>
+#include <arrow-glib/uint64-array-builder.h>
+#include <arrow-glib/uint64-data-type.h>
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/arrow-glib.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/arrow-glib.hpp b/c_glib/arrow-glib/arrow-glib.hpp
new file mode 100644
index 0000000..70fda8d
--- /dev/null
+++ b/c_glib/arrow-glib/arrow-glib.hpp
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <arrow-glib/arrow-glib.h>
+#include <arrow-glib/array.hpp>
+#include <arrow-glib/array-builder.hpp>
+#include <arrow-glib/boolean-array.hpp>
+#include <arrow-glib/boolean-data-type.hpp>
+#include <arrow-glib/chunked-array.hpp>
+#include <arrow-glib/column.hpp>
+#include <arrow-glib/data-type.hpp>
+#include <arrow-glib/double-array.hpp>
+#include <arrow-glib/error.hpp>
+#include <arrow-glib/field.hpp>
+#include <arrow-glib/float-array.hpp>
+#include <arrow-glib/record-batch.h>
+#include <arrow-glib/schema.hpp>
+#include <arrow-glib/table.hpp>
+#include <arrow-glib/type.hpp>
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/arrow-glib.pc.in
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/arrow-glib.pc.in b/c_glib/arrow-glib/arrow-glib.pc.in
new file mode 100644
index 0000000..f9f27b2
--- /dev/null
+++ b/c_glib/arrow-glib/arrow-glib.pc.in
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: Apache Arrow GLib
+Description: C API for Apache Arrow based on GLib
+Version: @VERSION@
+Libs: -L${libdir} -larrow-glib
+Cflags: -I${includedir}
+Requires: gobject-2.0 arrow
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/arrow-io-glib.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/arrow-io-glib.h b/c_glib/arrow-glib/arrow-io-glib.h
new file mode 100644
index 0000000..e02aa9b
--- /dev/null
+++ b/c_glib/arrow-glib/arrow-io-glib.h
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <arrow-glib/io-enums.h>
+#include <arrow-glib/io-file.h>
+#include <arrow-glib/io-file-mode.h>
+#include <arrow-glib/io-file-output-stream.h>
+#include <arrow-glib/io-input-stream.h>
+#include <arrow-glib/io-memory-mapped-file.h>
+#include <arrow-glib/io-output-stream.h>
+#include <arrow-glib/io-readable.h>
+#include <arrow-glib/io-readable-file.h>
+#include <arrow-glib/io-writeable.h>
+#include <arrow-glib/io-writeable-file.h>
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/arrow-io-glib.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/arrow-io-glib.hpp b/c_glib/arrow-glib/arrow-io-glib.hpp
new file mode 100644
index 0000000..378f202
--- /dev/null
+++ b/c_glib/arrow-glib/arrow-io-glib.hpp
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <arrow-glib/io-file.hpp>
+#include <arrow-glib/io-file-mode.hpp>
+#include <arrow-glib/io-file-output-stream.hpp>
+#include <arrow-glib/io-input-stream.hpp>
+#include <arrow-glib/io-memory-mapped-file.hpp>
+#include <arrow-glib/io-output-stream.hpp>
+#include <arrow-glib/io-readable.hpp>
+#include <arrow-glib/io-readable-file.hpp>
+#include <arrow-glib/io-writeable.hpp>
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/arrow-io-glib.pc.in
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/arrow-io-glib.pc.in b/c_glib/arrow-glib/arrow-io-glib.pc.in
new file mode 100644
index 0000000..4256184
--- /dev/null
+++ b/c_glib/arrow-glib/arrow-io-glib.pc.in
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: Apache Arrow I/O GLib
+Description: C API for Apache Arrow I/O based on GLib
+Version: @VERSION@
+Libs: -L${libdir} -larrow-glib-io
+Cflags: -I${includedir}
+Requires: arrow-glib arrow-io
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/arrow-ipc-glib.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/arrow-ipc-glib.h b/c_glib/arrow-glib/arrow-ipc-glib.h
new file mode 100644
index 0000000..4954d83
--- /dev/null
+++ b/c_glib/arrow-glib/arrow-ipc-glib.h
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <arrow-glib/ipc-enums.h>
+#include <arrow-glib/ipc-file-reader.h>
+#include <arrow-glib/ipc-file-writer.h>
+#include <arrow-glib/ipc-metadata-version.h>
+#include <arrow-glib/ipc-stream-reader.h>
+#include <arrow-glib/ipc-stream-writer.h>
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/arrow-ipc-glib.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/arrow-ipc-glib.hpp b/c_glib/arrow-glib/arrow-ipc-glib.hpp
new file mode 100644
index 0000000..d32bc05
--- /dev/null
+++ b/c_glib/arrow-glib/arrow-ipc-glib.hpp
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <arrow-glib/arrow-glib.hpp>
+
+#include <arrow-glib/arrow-io-glib.hpp>
+
+#include <arrow-glib/ipc-file-reader.hpp>
+#include <arrow-glib/ipc-file-writer.hpp>
+#include <arrow-glib/ipc-metadata-version.hpp>
+#include <arrow-glib/ipc-stream-reader.hpp>
+#include <arrow-glib/ipc-stream-writer.hpp>
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/arrow-ipc-glib.pc.in
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/arrow-ipc-glib.pc.in b/c_glib/arrow-glib/arrow-ipc-glib.pc.in
new file mode 100644
index 0000000..0b04c4a
--- /dev/null
+++ b/c_glib/arrow-glib/arrow-ipc-glib.pc.in
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: Apache Arrow IPC GLib
+Description: C API for Apache Arrow IPC based on GLib
+Version: @VERSION@
+Libs: -L${libdir} -larrow-glib-ipc
+Cflags: -I${includedir}
+Requires: arrow-glib-io arrow-ipc
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/binary-array-builder.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/binary-array-builder.cpp b/c_glib/arrow-glib/binary-array-builder.cpp
new file mode 100644
index 0000000..ab11535
--- /dev/null
+++ b/c_glib/arrow-glib/binary-array-builder.cpp
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <arrow-glib/array-builder.hpp>
+#include <arrow-glib/binary-array-builder.h>
+#include <arrow-glib/error.hpp>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: binary-array-builder
+ * @short_description: Binary array builder class
+ *
+ * #GArrowBinaryArrayBuilder is the class to create a new
+ * #GArrowBinaryArray.
+ */
+
+G_DEFINE_TYPE(GArrowBinaryArrayBuilder,
+ garrow_binary_array_builder,
+ GARROW_TYPE_ARRAY_BUILDER)
+
+static void
+garrow_binary_array_builder_init(GArrowBinaryArrayBuilder *builder)
+{
+}
+
+static void
+garrow_binary_array_builder_class_init(GArrowBinaryArrayBuilderClass *klass)
+{
+}
+
+/**
+ * garrow_binary_array_builder_new:
+ *
+ * Returns: A newly created #GArrowBinaryArrayBuilder.
+ */
+GArrowBinaryArrayBuilder *
+garrow_binary_array_builder_new(void)
+{
+ auto memory_pool = arrow::default_memory_pool();
+ auto arrow_builder =
+ std::make_shared<arrow::BinaryBuilder>(memory_pool, arrow::binary());
+ auto builder =
+ GARROW_BINARY_ARRAY_BUILDER(g_object_new(GARROW_TYPE_BINARY_ARRAY_BUILDER,
+ "array-builder", &arrow_builder,
+ NULL));
+ return builder;
+}
+
+/**
+ * garrow_binary_array_builder_append:
+ * @builder: A #GArrowBinaryArrayBuilder.
+ * @value: (array length=length): A binary value.
+ * @length: A value length.
+ * @error: (nullable): Return location for a #GError or %NULL.
+ *
+ * Returns: %TRUE on success, %FALSE if there was an error.
+ */
+gboolean
+garrow_binary_array_builder_append(GArrowBinaryArrayBuilder *builder,
+ const guint8 *value,
+ gint32 length,
+ GError **error)
+{
+ auto arrow_builder =
+ static_cast<arrow::BinaryBuilder *>(
+ garrow_array_builder_get_raw(GARROW_ARRAY_BUILDER(builder)).get());
+
+ auto status = arrow_builder->Append(value, length);
+ if (status.ok()) {
+ return TRUE;
+ } else {
+ garrow_error_set(error, status, "[binary-array-builder][append]");
+ return FALSE;
+ }
+}
+
+/**
+ * garrow_binary_array_builder_append_null:
+ * @builder: A #GArrowBinaryArrayBuilder.
+ * @error: (nullable): Return location for a #GError or %NULL.
+ *
+ * Returns: %TRUE on success, %FALSE if there was an error.
+ */
+gboolean
+garrow_binary_array_builder_append_null(GArrowBinaryArrayBuilder *builder,
+ GError **error)
+{
+ auto arrow_builder =
+ static_cast<arrow::BinaryBuilder *>(
+ garrow_array_builder_get_raw(GARROW_ARRAY_BUILDER(builder)).get());
+
+ auto status = arrow_builder->AppendNull();
+ if (status.ok()) {
+ return TRUE;
+ } else {
+ garrow_error_set(error, status, "[binary-array-builder][append-null]");
+ return FALSE;
+ }
+}
+
+G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/binary-array-builder.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/binary-array-builder.h b/c_glib/arrow-glib/binary-array-builder.h
new file mode 100644
index 0000000..111a83a
--- /dev/null
+++ b/c_glib/arrow-glib/binary-array-builder.h
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <arrow-glib/array-builder.h>
+
+G_BEGIN_DECLS
+
+#define GARROW_TYPE_BINARY_ARRAY_BUILDER \
+ (garrow_binary_array_builder_get_type())
+#define GARROW_BINARY_ARRAY_BUILDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+ GARROW_TYPE_BINARY_ARRAY_BUILDER, \
+ GArrowBinaryArrayBuilder))
+#define GARROW_BINARY_ARRAY_BUILDER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), \
+ GARROW_TYPE_BINARY_ARRAY_BUILDER, \
+ GArrowBinaryArrayBuilderClass))
+#define GARROW_IS_BINARY_ARRAY_BUILDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+ GARROW_TYPE_BINARY_ARRAY_BUILDER))
+#define GARROW_IS_BINARY_ARRAY_BUILDER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass), \
+ GARROW_TYPE_BINARY_ARRAY_BUILDER))
+#define GARROW_BINARY_ARRAY_BUILDER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS((obj), \
+ GARROW_TYPE_BINARY_ARRAY_BUILDER, \
+ GArrowBinaryArrayBuilderClass))
+
+typedef struct _GArrowBinaryArrayBuilder GArrowBinaryArrayBuilder;
+typedef struct _GArrowBinaryArrayBuilderClass GArrowBinaryArrayBuilderClass;
+
+/**
+ * GArrowBinaryArrayBuilder:
+ *
+ * It wraps `arrow::BinaryBuilder`.
+ */
+struct _GArrowBinaryArrayBuilder
+{
+ /*< private >*/
+ GArrowArrayBuilder parent_instance;
+};
+
+struct _GArrowBinaryArrayBuilderClass
+{
+ GArrowArrayBuilderClass parent_class;
+};
+
+GType garrow_binary_array_builder_get_type(void) G_GNUC_CONST;
+
+GArrowBinaryArrayBuilder *garrow_binary_array_builder_new(void);
+
+gboolean garrow_binary_array_builder_append(GArrowBinaryArrayBuilder *builder,
+ const guint8 *value,
+ gint32 length,
+ GError **error);
+gboolean garrow_binary_array_builder_append_null(GArrowBinaryArrayBuilder *builder,
+ GError **error);
+
+G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/binary-array.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/binary-array.cpp b/c_glib/arrow-glib/binary-array.cpp
new file mode 100644
index 0000000..c149d14
--- /dev/null
+++ b/c_glib/arrow-glib/binary-array.cpp
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <arrow-glib/array.hpp>
+#include <arrow-glib/binary-array.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: binary-array
+ * @short_description: Binary array class
+ *
+ * #GArrowBinaryArray is a class for binary array. It can store zero
+ * or more binary data.
+ *
+ * #GArrowBinaryArray is immutable. You need to use
+ * #GArrowBinaryArrayBuilder to create a new array.
+ */
+
+G_DEFINE_TYPE(GArrowBinaryArray, \
+ garrow_binary_array, \
+ GARROW_TYPE_ARRAY)
+
+static void
+garrow_binary_array_init(GArrowBinaryArray *object)
+{
+}
+
+static void
+garrow_binary_array_class_init(GArrowBinaryArrayClass *klass)
+{
+}
+
+/**
+ * garrow_binary_array_get_value:
+ * @array: A #GArrowBinaryArray.
+ * @i: The index of the target value.
+ * @length: (out): The length of the value.
+ *
+ * Returns: (array length=length): The i-th value.
+ */
+const guint8 *
+garrow_binary_array_get_value(GArrowBinaryArray *array,
+ gint64 i,
+ gint32 *length)
+{
+ auto arrow_array = garrow_array_get_raw(GARROW_ARRAY(array));
+ auto arrow_binary_array =
+ static_cast<arrow::BinaryArray *>(arrow_array.get());
+ return arrow_binary_array->GetValue(i, length);
+}
+
+G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/binary-array.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/binary-array.h b/c_glib/arrow-glib/binary-array.h
new file mode 100644
index 0000000..ab63ece
--- /dev/null
+++ b/c_glib/arrow-glib/binary-array.h
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <arrow-glib/array.h>
+
+G_BEGIN_DECLS
+
+#define GARROW_TYPE_BINARY_ARRAY \
+ (garrow_binary_array_get_type())
+#define GARROW_BINARY_ARRAY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+ GARROW_TYPE_BINARY_ARRAY, \
+ GArrowBinaryArray))
+#define GARROW_BINARY_ARRAY_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), \
+ GARROW_TYPE_BINARY_ARRAY, \
+ GArrowBinaryArrayClass))
+#define GARROW_IS_BINARY_ARRAY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+ GARROW_TYPE_BINARY_ARRAY))
+#define GARROW_IS_BINARY_ARRAY_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass), \
+ GARROW_TYPE_BINARY_ARRAY))
+#define GARROW_BINARY_ARRAY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS((obj), \
+ GARROW_TYPE_BINARY_ARRAY, \
+ GArrowBinaryArrayClass))
+
+typedef struct _GArrowBinaryArray GArrowBinaryArray;
+typedef struct _GArrowBinaryArrayClass GArrowBinaryArrayClass;
+
+/**
+ * GArrowBinaryArray:
+ *
+ * It wraps `arrow::BinaryArray`.
+ */
+struct _GArrowBinaryArray
+{
+ /*< private >*/
+ GArrowArray parent_instance;
+};
+
+struct _GArrowBinaryArrayClass
+{
+ GArrowArrayClass parent_class;
+};
+
+GType garrow_binary_array_get_type(void) G_GNUC_CONST;
+
+const guint8 *garrow_binary_array_get_value(GArrowBinaryArray *array,
+ gint64 i,
+ gint32 *length);
+
+G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/binary-data-type.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/binary-data-type.cpp b/c_glib/arrow-glib/binary-data-type.cpp
new file mode 100644
index 0000000..e5187f7
--- /dev/null
+++ b/c_glib/arrow-glib/binary-data-type.cpp
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <arrow-glib/data-type.hpp>
+#include <arrow-glib/binary-data-type.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: binary-data-type
+ * @short_description: Binary data type
+ *
+ * #GArrowBinaryDataType is a class for binary data type.
+ */
+
+G_DEFINE_TYPE(GArrowBinaryDataType, \
+ garrow_binary_data_type, \
+ GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_binary_data_type_init(GArrowBinaryDataType *object)
+{
+}
+
+static void
+garrow_binary_data_type_class_init(GArrowBinaryDataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_binary_data_type_new:
+ *
+ * Returns: The newly created binary data type.
+ */
+GArrowBinaryDataType *
+garrow_binary_data_type_new(void)
+{
+ auto arrow_data_type = arrow::binary();
+
+ GArrowBinaryDataType *data_type =
+ GARROW_BINARY_DATA_TYPE(g_object_new(GARROW_TYPE_BINARY_DATA_TYPE,
+ "data-type", &arrow_data_type,
+ NULL));
+ return data_type;
+}
+
+G_END_DECLS