arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject [2/2] arrow git commit: ARROW-1528: [GLib] Resolve recursive include dependency
Date Tue, 12 Sep 2017 15:00:16 GMT
ARROW-1528: [GLib] Resolve recursive include dependency

Before:

  * arrow-glib/field.h depends on arrow-glib/data-type.h
  * arrow-glib/data-type.h depends on arrow-glib/field.h

After:

  * arrow-glib/field.h depends on arrow-glib/basic-data-type.h
  * arrow-glib/basic-data-type.h doesn't depend on arrow-glib/field.h
  * arrow-glib/composite-data-type.h depends on
    arrow-glib/basic-data-type.h and
    arrow-glib/composite-data-type.h

Author: Kouhei Sutou <kou@clear-code.com>

Closes #1091 from kou/glib-resolve-recursive-dependency and squashes the following commits:

a43c29b3 [Kouhei Sutou] [GLib] Fix document build error
490c6259 [Kouhei Sutou] [GLib] Resolve recursive include dependency


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/b77af1a1
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/b77af1a1
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/b77af1a1

Branch: refs/heads/master
Commit: b77af1a1b6f5a6532d39e4b228bb939e8837d09f
Parents: 6a020a1
Author: Kouhei Sutou <kou@clear-code.com>
Authored: Tue Sep 12 11:00:11 2017 -0400
Committer: Wes McKinney <wes.mckinney@twosigma.com>
Committed: Tue Sep 12 11:00:11 2017 -0400

----------------------------------------------------------------------
 c_glib/arrow-glib/Makefile.am             |    6 +-
 c_glib/arrow-glib/basic-data-type.cpp     | 1035 ++++++++++++++++++++++
 c_glib/arrow-glib/basic-data-type.h       |  954 ++++++++++++++++++++
 c_glib/arrow-glib/basic-data-type.hpp     |   27 +
 c_glib/arrow-glib/composite-data-type.cpp |  136 +++
 c_glib/arrow-glib/composite-data-type.h   |  115 +++
 c_glib/arrow-glib/compute.cpp             |    2 +-
 c_glib/arrow-glib/data-type.cpp           | 1133 ------------------------
 c_glib/arrow-glib/data-type.h             | 1030 +--------------------
 c_glib/arrow-glib/data-type.hpp           |    8 +-
 c_glib/arrow-glib/field.h                 |    2 +-
 c_glib/doc/reference/arrow-glib-docs.sgml |    7 +-
 12 files changed, 2284 insertions(+), 2171 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/b77af1a1/c_glib/arrow-glib/Makefile.am
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/Makefile.am b/c_glib/arrow-glib/Makefile.am
index fafd6d2..cde62cd 100644
--- a/c_glib/arrow-glib/Makefile.am
+++ b/c_glib/arrow-glib/Makefile.am
@@ -44,9 +44,11 @@ libarrow_glib_la_headers =			\
 	array.h					\
 	array-builder.h				\
 	arrow-glib.h				\
+	basic-data-type.h			\
 	buffer.h				\
 	chunked-array.h				\
 	column.h				\
+	composite-data-type.h			\
 	data-type.h				\
 	error.h					\
 	field.h					\
@@ -83,10 +85,11 @@ libarrow_glib_la_generated_sources =		\
 libarrow_glib_la_sources =			\
 	array.cpp				\
 	array-builder.cpp			\
+	basic-data-type.cpp			\
 	buffer.cpp				\
 	chunked-array.cpp			\
 	column.cpp				\
-	data-type.cpp				\
+	composite-data-type.cpp			\
 	error.cpp				\
 	field.cpp				\
 	record-batch.cpp			\
@@ -118,6 +121,7 @@ libarrow_glib_la_cpp_headers =			\
 	array.hpp				\
 	array-builder.hpp			\
 	arrow-glib.hpp				\
+	basic-data-type.hpp			\
 	buffer.hpp				\
 	chunked-array.hpp			\
 	column.hpp				\

http://git-wip-us.apache.org/repos/asf/arrow/blob/b77af1a1/c_glib/arrow-glib/basic-data-type.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/basic-data-type.cpp b/c_glib/arrow-glib/basic-data-type.cpp
new file mode 100644
index 0000000..62f8a7e
--- /dev/null
+++ b/c_glib/arrow-glib/basic-data-type.cpp
@@ -0,0 +1,1035 @@
+/*
+ * 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/enums.h>
+#include <arrow-glib/error.hpp>
+#include <arrow-glib/field.hpp>
+#include <arrow-glib/type.hpp>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: basic-data-type
+ * @section_id: basic-data-type-classes
+ * @title: Basic data type classes
+ * @include: arrow-glib/arrow-glib.h
+ *
+ * #GArrowDataType is a base class for all data type classes such as
+ * #GArrowBooleanDataType.
+ *
+ * #GArrowNullDataType is a class for null data type.
+ *
+ * #GArrowBooleanDataType is a class for boolean data type.
+ *
+ * #GArrowInt8DataType is a class for 8-bit integer data type.
+ *
+ * #GArrowUInt8DataType is a class for 8-bit unsigned integer data type.
+ *
+ * #GArrowInt16DataType is a class for 16-bit integer data type.
+ *
+ * #GArrowUInt16DataType is a class for 16-bit unsigned integer data type.
+ *
+ * #GArrowInt32DataType is a class for 32-bit integer data type.
+ *
+ * #GArrowUInt32DataType is a class for 32-bit unsigned integer data type.
+ *
+ * #GArrowInt64DataType is a class for 64-bit integer data type.
+ *
+ * #GArrowUInt64DataType is a class for 64-bit unsigned integer data type.
+ *
+ * #GArrowFloatDataType is a class for 32-bit floating point data
+ * type.
+ *
+ * #GArrowDoubleDataType is a class for 64-bit floating point data
+ * type.
+ *
+ * #GArrowBinaryDataType is a class for binary data type.
+ *
+ * #GArrowStringDataType is a class for UTF-8 encoded string data
+ * type.
+ *
+ * #GArrowDate32DataType is a class for the number of days since UNIX
+ * epoch in 32-bit signed integer data type.
+ *
+ * #GArrowDate64DataType is a class for the number of milliseconds
+ * since UNIX epoch in 64-bit signed integer data type.
+ *
+ * #GArrowTimestampDataType is a class for the number of
+ * seconds/milliseconds/microseconds/nanoseconds since UNIX epoch in
+ * 64-bit signed integer data type.
+ *
+ * #GArrowTime32DataType is a class for the number of seconds or
+ * milliseconds since midnight in 32-bit signed integer data type.
+ *
+ * #GArrowTime64DataType is a class for the number of microseconds or
+ * nanoseconds since midnight in 64-bit signed integer data type.
+ */
+
+typedef struct GArrowDataTypePrivate_ {
+  std::shared_ptr<arrow::DataType> data_type;
+} GArrowDataTypePrivate;
+
+enum {
+  PROP_0,
+  PROP_DATA_TYPE
+};
+
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(GArrowDataType,
+                                    garrow_data_type,
+                                    G_TYPE_OBJECT)
+
+#define GARROW_DATA_TYPE_GET_PRIVATE(obj)               \
+  (G_TYPE_INSTANCE_GET_PRIVATE((obj),                   \
+                               GARROW_TYPE_DATA_TYPE,   \
+                               GArrowDataTypePrivate))
+
+static void
+garrow_data_type_finalize(GObject *object)
+{
+  GArrowDataTypePrivate *priv;
+
+  priv = GARROW_DATA_TYPE_GET_PRIVATE(object);
+
+  priv->data_type = nullptr;
+
+  G_OBJECT_CLASS(garrow_data_type_parent_class)->finalize(object);
+}
+
+static void
+garrow_data_type_set_property(GObject *object,
+                              guint prop_id,
+                              const GValue *value,
+                              GParamSpec *pspec)
+{
+  GArrowDataTypePrivate *priv;
+
+  priv = GARROW_DATA_TYPE_GET_PRIVATE(object);
+
+  switch (prop_id) {
+  case PROP_DATA_TYPE:
+    priv->data_type =
+      *static_cast<std::shared_ptr<arrow::DataType> *>(g_value_get_pointer(value));
+    break;
+  default:
+    G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+    break;
+  }
+}
+
+static void
+garrow_data_type_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_data_type_init(GArrowDataType *object)
+{
+}
+
+static void
+garrow_data_type_class_init(GArrowDataTypeClass *klass)
+{
+  GObjectClass *gobject_class;
+  GParamSpec *spec;
+
+  gobject_class = G_OBJECT_CLASS(klass);
+
+  gobject_class->finalize     = garrow_data_type_finalize;
+  gobject_class->set_property = garrow_data_type_set_property;
+  gobject_class->get_property = garrow_data_type_get_property;
+
+  spec = g_param_spec_pointer("data-type",
+                              "DataType",
+                              "The raw std::shared<arrow::DataType> *",
+                              static_cast<GParamFlags>(G_PARAM_WRITABLE |
+                                                       G_PARAM_CONSTRUCT_ONLY));
+  g_object_class_install_property(gobject_class, PROP_DATA_TYPE, spec);
+}
+
+/**
+ * garrow_data_type_equal:
+ * @data_type: A #GArrowDataType.
+ * @other_data_type: A #GArrowDataType to be compared.
+ *
+ * Returns: %TRUE if both of them have the same data, %FALSE
+ *   otherwise.
+ */
+gboolean
+garrow_data_type_equal(GArrowDataType *data_type,
+                       GArrowDataType *other_data_type)
+{
+  const auto arrow_data_type = garrow_data_type_get_raw(data_type);
+  const auto arrow_other_data_type = garrow_data_type_get_raw(other_data_type);
+  return arrow_data_type->Equals(arrow_other_data_type);
+}
+
+/**
+ * garrow_data_type_to_string:
+ * @data_type: A #GArrowDataType.
+ *
+ * Returns: The string representation of the data type. The caller
+ *   must free it by g_free() when the caller doesn't need it anymore.
+ */
+gchar *
+garrow_data_type_to_string(GArrowDataType *data_type)
+{
+  const auto arrow_data_type = garrow_data_type_get_raw(data_type);
+  return g_strdup(arrow_data_type->ToString().c_str());
+}
+
+/**
+ * garrow_data_type_get_id:
+ * @data_type: A #GArrowDataType.
+ *
+ * Returns: The #GArrowType of the data type.
+ */
+GArrowType
+garrow_data_type_get_id(GArrowDataType *data_type)
+{
+  const auto arrow_data_type = garrow_data_type_get_raw(data_type);
+  return garrow_type_from_raw(arrow_data_type->id());
+}
+
+
+G_DEFINE_TYPE(GArrowNullDataType,                \
+              garrow_null_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_null_data_type_init(GArrowNullDataType *object)
+{
+}
+
+static void
+garrow_null_data_type_class_init(GArrowNullDataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_null_data_type_new:
+ *
+ * Returns: The newly created null data type.
+ */
+GArrowNullDataType *
+garrow_null_data_type_new(void)
+{
+  auto arrow_data_type = arrow::null();
+
+  GArrowNullDataType *data_type =
+    GARROW_NULL_DATA_TYPE(g_object_new(GARROW_TYPE_NULL_DATA_TYPE,
+                                       "data-type", &arrow_data_type,
+                                       NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowBooleanDataType,                \
+              garrow_boolean_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_boolean_data_type_init(GArrowBooleanDataType *object)
+{
+}
+
+static void
+garrow_boolean_data_type_class_init(GArrowBooleanDataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_boolean_data_type_new:
+ *
+ * Returns: The newly created boolean data type.
+ */
+GArrowBooleanDataType *
+garrow_boolean_data_type_new(void)
+{
+  auto arrow_data_type = arrow::boolean();
+
+  GArrowBooleanDataType *data_type =
+    GARROW_BOOLEAN_DATA_TYPE(g_object_new(GARROW_TYPE_BOOLEAN_DATA_TYPE,
+                                          "data-type", &arrow_data_type,
+                                          NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowInt8DataType,                \
+              garrow_int8_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_int8_data_type_init(GArrowInt8DataType *object)
+{
+}
+
+static void
+garrow_int8_data_type_class_init(GArrowInt8DataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_int8_data_type_new:
+ *
+ * Returns: The newly created 8-bit integer data type.
+ */
+GArrowInt8DataType *
+garrow_int8_data_type_new(void)
+{
+  auto arrow_data_type = arrow::int8();
+
+  GArrowInt8DataType *data_type =
+    GARROW_INT8_DATA_TYPE(g_object_new(GARROW_TYPE_INT8_DATA_TYPE,
+                                       "data-type", &arrow_data_type,
+                                       NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowUInt8DataType,                \
+              garrow_uint8_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_uint8_data_type_init(GArrowUInt8DataType *object)
+{
+}
+
+static void
+garrow_uint8_data_type_class_init(GArrowUInt8DataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_uint8_data_type_new:
+ *
+ * Returns: The newly created 8-bit unsigned integer data type.
+ */
+GArrowUInt8DataType *
+garrow_uint8_data_type_new(void)
+{
+  auto arrow_data_type = arrow::uint8();
+
+  GArrowUInt8DataType *data_type =
+    GARROW_UINT8_DATA_TYPE(g_object_new(GARROW_TYPE_UINT8_DATA_TYPE,
+                                        "data-type", &arrow_data_type,
+                                        NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowInt16DataType,                \
+              garrow_int16_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_int16_data_type_init(GArrowInt16DataType *object)
+{
+}
+
+static void
+garrow_int16_data_type_class_init(GArrowInt16DataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_int16_data_type_new:
+ *
+ * Returns: The newly created 16-bit integer data type.
+ */
+GArrowInt16DataType *
+garrow_int16_data_type_new(void)
+{
+  auto arrow_data_type = arrow::int16();
+
+  GArrowInt16DataType *data_type =
+    GARROW_INT16_DATA_TYPE(g_object_new(GARROW_TYPE_INT16_DATA_TYPE,
+                                        "data-type", &arrow_data_type,
+                                        NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowUInt16DataType,                \
+              garrow_uint16_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_uint16_data_type_init(GArrowUInt16DataType *object)
+{
+}
+
+static void
+garrow_uint16_data_type_class_init(GArrowUInt16DataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_uint16_data_type_new:
+ *
+ * Returns: The newly created 16-bit unsigned integer data type.
+ */
+GArrowUInt16DataType *
+garrow_uint16_data_type_new(void)
+{
+  auto arrow_data_type = arrow::uint16();
+
+  GArrowUInt16DataType *data_type =
+    GARROW_UINT16_DATA_TYPE(g_object_new(GARROW_TYPE_UINT16_DATA_TYPE,
+                                         "data-type", &arrow_data_type,
+                                         NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowInt32DataType,                \
+              garrow_int32_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_int32_data_type_init(GArrowInt32DataType *object)
+{
+}
+
+static void
+garrow_int32_data_type_class_init(GArrowInt32DataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_int32_data_type_new:
+ *
+ * Returns: The newly created 32-bit integer data type.
+ */
+GArrowInt32DataType *
+garrow_int32_data_type_new(void)
+{
+  auto arrow_data_type = arrow::int32();
+
+  GArrowInt32DataType *data_type =
+    GARROW_INT32_DATA_TYPE(g_object_new(GARROW_TYPE_INT32_DATA_TYPE,
+                                        "data-type", &arrow_data_type,
+                                        NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowUInt32DataType,                \
+              garrow_uint32_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_uint32_data_type_init(GArrowUInt32DataType *object)
+{
+}
+
+static void
+garrow_uint32_data_type_class_init(GArrowUInt32DataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_uint32_data_type_new:
+ *
+ * Returns: The newly created 32-bit unsigned integer data type.
+ */
+GArrowUInt32DataType *
+garrow_uint32_data_type_new(void)
+{
+  auto arrow_data_type = arrow::uint32();
+
+  GArrowUInt32DataType *data_type =
+    GARROW_UINT32_DATA_TYPE(g_object_new(GARROW_TYPE_UINT32_DATA_TYPE,
+                                         "data-type", &arrow_data_type,
+                                         NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowInt64DataType,                \
+              garrow_int64_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_int64_data_type_init(GArrowInt64DataType *object)
+{
+}
+
+static void
+garrow_int64_data_type_class_init(GArrowInt64DataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_int64_data_type_new:
+ *
+ * Returns: The newly created 64-bit integer data type.
+ */
+GArrowInt64DataType *
+garrow_int64_data_type_new(void)
+{
+  auto arrow_data_type = arrow::int64();
+
+  GArrowInt64DataType *data_type =
+    GARROW_INT64_DATA_TYPE(g_object_new(GARROW_TYPE_INT64_DATA_TYPE,
+                                        "data-type", &arrow_data_type,
+                                        NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowUInt64DataType,                \
+              garrow_uint64_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_uint64_data_type_init(GArrowUInt64DataType *object)
+{
+}
+
+static void
+garrow_uint64_data_type_class_init(GArrowUInt64DataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_uint64_data_type_new:
+ *
+ * Returns: The newly created 64-bit unsigned integer data type.
+ */
+GArrowUInt64DataType *
+garrow_uint64_data_type_new(void)
+{
+  auto arrow_data_type = arrow::uint64();
+
+  GArrowUInt64DataType *data_type =
+    GARROW_UINT64_DATA_TYPE(g_object_new(GARROW_TYPE_UINT64_DATA_TYPE,
+                                         "data-type", &arrow_data_type,
+                                         NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowFloatDataType,                \
+              garrow_float_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_float_data_type_init(GArrowFloatDataType *object)
+{
+}
+
+static void
+garrow_float_data_type_class_init(GArrowFloatDataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_float_data_type_new:
+ *
+ * Returns: The newly created float data type.
+ */
+GArrowFloatDataType *
+garrow_float_data_type_new(void)
+{
+  auto arrow_data_type = arrow::float32();
+
+  GArrowFloatDataType *data_type =
+    GARROW_FLOAT_DATA_TYPE(g_object_new(GARROW_TYPE_FLOAT_DATA_TYPE,
+                                        "data-type", &arrow_data_type,
+                                        NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowDoubleDataType,                \
+              garrow_double_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_double_data_type_init(GArrowDoubleDataType *object)
+{
+}
+
+static void
+garrow_double_data_type_class_init(GArrowDoubleDataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_double_data_type_new:
+ *
+ * Returns: The newly created 64-bit floating point data type.
+ */
+GArrowDoubleDataType *
+garrow_double_data_type_new(void)
+{
+  auto arrow_data_type = arrow::float64();
+
+  GArrowDoubleDataType *data_type =
+    GARROW_DOUBLE_DATA_TYPE(g_object_new(GARROW_TYPE_DOUBLE_DATA_TYPE,
+                                         "data-type", &arrow_data_type,
+                                         NULL));
+  return 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_DEFINE_TYPE(GArrowStringDataType,                \
+              garrow_string_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_string_data_type_init(GArrowStringDataType *object)
+{
+}
+
+static void
+garrow_string_data_type_class_init(GArrowStringDataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_string_data_type_new:
+ *
+ * Returns: The newly created UTF-8 encoded string data type.
+ */
+GArrowStringDataType *
+garrow_string_data_type_new(void)
+{
+  auto arrow_data_type = arrow::utf8();
+
+  GArrowStringDataType *data_type =
+    GARROW_STRING_DATA_TYPE(g_object_new(GARROW_TYPE_STRING_DATA_TYPE,
+                                         "data-type", &arrow_data_type,
+                                         NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowDate32DataType,                \
+              garrow_date32_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_date32_data_type_init(GArrowDate32DataType *object)
+{
+}
+
+static void
+garrow_date32_data_type_class_init(GArrowDate32DataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_date32_data_type_new:
+ *
+ * Returns: A newly created the number of milliseconds
+ *   since UNIX epoch in 32-bit signed integer data type.
+ *
+ * Since: 0.7.0
+ */
+GArrowDate32DataType *
+garrow_date32_data_type_new(void)
+{
+  auto arrow_data_type = arrow::date32();
+
+  GArrowDate32DataType *data_type =
+    GARROW_DATE32_DATA_TYPE(g_object_new(GARROW_TYPE_DATE32_DATA_TYPE,
+                                         "data-type", &arrow_data_type,
+                                         NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowDate64DataType,                \
+              garrow_date64_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_date64_data_type_init(GArrowDate64DataType *object)
+{
+}
+
+static void
+garrow_date64_data_type_class_init(GArrowDate64DataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_date64_data_type_new:
+ *
+ * Returns: A newly created the number of milliseconds
+ *   since UNIX epoch in 64-bit signed integer data type.
+ *
+ * Since: 0.7.0
+ */
+GArrowDate64DataType *
+garrow_date64_data_type_new(void)
+{
+  auto arrow_data_type = arrow::date64();
+
+  GArrowDate64DataType *data_type =
+    GARROW_DATE64_DATA_TYPE(g_object_new(GARROW_TYPE_DATE64_DATA_TYPE,
+                                         "data-type", &arrow_data_type,
+                                         NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowTimestampDataType,                \
+              garrow_timestamp_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_timestamp_data_type_init(GArrowTimestampDataType *object)
+{
+}
+
+static void
+garrow_timestamp_data_type_class_init(GArrowTimestampDataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_timestamp_data_type_new:
+ * @unit: The unit of the timestamp data.
+ *
+ * Returns: A newly created the number of
+ *   seconds/milliseconds/microseconds/nanoseconds since UNIX epoch in
+ *   64-bit signed integer data type.
+ *
+ * Since: 0.7.0
+ */
+GArrowTimestampDataType *
+garrow_timestamp_data_type_new(GArrowTimeUnit unit)
+{
+  auto arrow_unit = garrow_time_unit_to_raw(unit);
+  auto arrow_data_type = arrow::timestamp(arrow_unit);
+  auto data_type =
+    GARROW_TIMESTAMP_DATA_TYPE(g_object_new(GARROW_TYPE_TIMESTAMP_DATA_TYPE,
+                                            "data-type", &arrow_data_type,
+                                            NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowTimeDataType,               \
+              garrow_time_data_type,            \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_time_data_type_init(GArrowTimeDataType *object)
+{
+}
+
+static void
+garrow_time_data_type_class_init(GArrowTimeDataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_time_data_type_get_unit:
+ * @time_data_type: The #GArrowTimeDataType.
+ *
+ * Returns: The unit of the time data type.
+ *
+ * Since: 0.7.0
+ */
+GArrowTimeUnit
+garrow_time_data_type_get_unit(GArrowTimeDataType *time_data_type)
+{
+  const auto arrow_data_type =
+    garrow_data_type_get_raw(GARROW_DATA_TYPE(time_data_type));
+  const auto arrow_time_data_type =
+    std::static_pointer_cast<arrow::TimeType>(arrow_data_type);
+  return garrow_time_unit_from_raw(arrow_time_data_type->unit());
+}
+
+
+G_DEFINE_TYPE(GArrowTime32DataType,                \
+              garrow_time32_data_type,             \
+              GARROW_TYPE_TIME_DATA_TYPE)
+
+static void
+garrow_time32_data_type_init(GArrowTime32DataType *object)
+{
+}
+
+static void
+garrow_time32_data_type_class_init(GArrowTime32DataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_time32_data_type_new:
+ * @unit: %GARROW_TIME_UNIT_SECOND or %GARROW_TIME_UNIT_MILLI.
+ * @error: (nullable): Return location for a #GError or %NULL.
+ *
+ * Returns: (nullable):
+ *   A newly created the number of seconds or milliseconds since
+ *   midnight in 32-bit signed integer data type.
+ *
+ * Since: 0.7.0
+ */
+GArrowTime32DataType *
+garrow_time32_data_type_new(GArrowTimeUnit unit, GError **error)
+{
+  switch (unit) {
+  case GARROW_TIME_UNIT_SECOND:
+  case GARROW_TIME_UNIT_MILLI:
+    break;
+  default:
+    {
+      auto enum_class = G_ENUM_CLASS(g_type_class_ref(GARROW_TYPE_TIME_UNIT));
+      GEnumValue *value = g_enum_get_value(enum_class, unit);
+      if (value) {
+        g_set_error(error,
+                    GARROW_ERROR,
+                    GARROW_ERROR_INVALID,
+                    "[time32-data-type][new] time unit must be second or milli: "
+                    "<%s>",
+                    value->value_nick);
+      } else {
+        g_set_error(error,
+                    GARROW_ERROR,
+                    GARROW_ERROR_INVALID,
+                    "[time32-data-type][new] "
+                    "time unit must be second(%d) or milli(%d): <%d>",
+                    GARROW_TIME_UNIT_SECOND,
+                    GARROW_TIME_UNIT_MILLI,
+                    unit);
+      }
+      g_type_class_unref(enum_class);
+    }
+    return NULL;
+  }
+
+  auto arrow_unit = garrow_time_unit_to_raw(unit);
+  auto arrow_data_type = arrow::time32(arrow_unit);
+  auto data_type =
+    GARROW_TIME32_DATA_TYPE(g_object_new(GARROW_TYPE_TIME32_DATA_TYPE,
+                                         "data-type", &arrow_data_type,
+                                         NULL));
+  return data_type;
+}
+
+
+G_DEFINE_TYPE(GArrowTime64DataType,                \
+              garrow_time64_data_type,             \
+              GARROW_TYPE_TIME_DATA_TYPE)
+
+static void
+garrow_time64_data_type_init(GArrowTime64DataType *object)
+{
+}
+
+static void
+garrow_time64_data_type_class_init(GArrowTime64DataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_time64_data_type_new:
+ * @unit: %GARROW_TIME_UNIT_SECOND or %GARROW_TIME_UNIT_MILLI.
+ * @error: (nullable): Return location for a #GError or %NULL.
+ *
+ * Returns: (nullable):
+ *   A newly created the number of seconds or milliseconds since
+ *   midnight in 64-bit signed integer data type.
+ *
+ * Since: 0.7.0
+ */
+GArrowTime64DataType *
+garrow_time64_data_type_new(GArrowTimeUnit unit, GError **error)
+{
+  switch (unit) {
+  case GARROW_TIME_UNIT_MICRO:
+  case GARROW_TIME_UNIT_NANO:
+    break;
+  default:
+    {
+      auto enum_class = G_ENUM_CLASS(g_type_class_ref(GARROW_TYPE_TIME_UNIT));
+      auto value = g_enum_get_value(enum_class, unit);
+      if (value) {
+        g_set_error(error,
+                    GARROW_ERROR,
+                    GARROW_ERROR_INVALID,
+                    "[time64-data-type][new] time unit must be micro or nano: "
+                    "<%s>",
+                    value->value_nick);
+      } else {
+        g_set_error(error,
+                    GARROW_ERROR,
+                    GARROW_ERROR_INVALID,
+                    "[time64-data-type][new] "
+                    "time unit must be micro(%d) or nano(%d): <%d>",
+                    GARROW_TIME_UNIT_MICRO,
+                    GARROW_TIME_UNIT_NANO,
+                    unit);
+      }
+      g_type_class_unref(enum_class);
+    }
+    return NULL;
+  }
+
+  auto arrow_unit = garrow_time_unit_to_raw(unit);
+  auto arrow_data_type = arrow::time64(arrow_unit);
+  auto data_type =
+    GARROW_TIME64_DATA_TYPE(g_object_new(GARROW_TYPE_TIME64_DATA_TYPE,
+                                         "data-type", &arrow_data_type,
+                                         NULL));
+  return data_type;
+}
+
+G_END_DECLS
+
+GArrowDataType *
+garrow_data_type_new_raw(std::shared_ptr<arrow::DataType> *arrow_data_type)
+{
+  GType type;
+  GArrowDataType *data_type;
+
+  switch ((*arrow_data_type)->id()) {
+  case arrow::Type::type::NA:
+    type = GARROW_TYPE_NULL_DATA_TYPE;
+    break;
+  case arrow::Type::type::BOOL:
+    type = GARROW_TYPE_BOOLEAN_DATA_TYPE;
+    break;
+  case arrow::Type::type::UINT8:
+    type = GARROW_TYPE_UINT8_DATA_TYPE;
+    break;
+  case arrow::Type::type::INT8:
+    type = GARROW_TYPE_INT8_DATA_TYPE;
+    break;
+  case arrow::Type::type::UINT16:
+    type = GARROW_TYPE_UINT16_DATA_TYPE;
+    break;
+  case arrow::Type::type::INT16:
+    type = GARROW_TYPE_INT16_DATA_TYPE;
+    break;
+  case arrow::Type::type::UINT32:
+    type = GARROW_TYPE_UINT32_DATA_TYPE;
+    break;
+  case arrow::Type::type::INT32:
+    type = GARROW_TYPE_INT32_DATA_TYPE;
+    break;
+  case arrow::Type::type::UINT64:
+    type = GARROW_TYPE_UINT64_DATA_TYPE;
+    break;
+  case arrow::Type::type::INT64:
+    type = GARROW_TYPE_INT64_DATA_TYPE;
+    break;
+  case arrow::Type::type::FLOAT:
+    type = GARROW_TYPE_FLOAT_DATA_TYPE;
+    break;
+  case arrow::Type::type::DOUBLE:
+    type = GARROW_TYPE_DOUBLE_DATA_TYPE;
+    break;
+  case arrow::Type::type::BINARY:
+    type = GARROW_TYPE_BINARY_DATA_TYPE;
+    break;
+  case arrow::Type::type::STRING:
+    type = GARROW_TYPE_STRING_DATA_TYPE;
+    break;
+  case arrow::Type::type::DATE32:
+    type = GARROW_TYPE_DATE32_DATA_TYPE;
+    break;
+  case arrow::Type::type::DATE64:
+    type = GARROW_TYPE_DATE64_DATA_TYPE;
+    break;
+  case arrow::Type::type::TIMESTAMP:
+    type = GARROW_TYPE_TIMESTAMP_DATA_TYPE;
+    break;
+  case arrow::Type::type::TIME32:
+    type = GARROW_TYPE_TIME32_DATA_TYPE;
+    break;
+  case arrow::Type::type::TIME64:
+    type = GARROW_TYPE_TIME64_DATA_TYPE;
+    break;
+  case arrow::Type::type::LIST:
+    type = GARROW_TYPE_LIST_DATA_TYPE;
+    break;
+  case arrow::Type::type::STRUCT:
+    type = GARROW_TYPE_STRUCT_DATA_TYPE;
+    break;
+  default:
+    type = GARROW_TYPE_DATA_TYPE;
+    break;
+  }
+  data_type = GARROW_DATA_TYPE(g_object_new(type,
+                                            "data_type", arrow_data_type,
+                                            NULL));
+  return data_type;
+}
+
+std::shared_ptr<arrow::DataType>
+garrow_data_type_get_raw(GArrowDataType *data_type)
+{
+  GArrowDataTypePrivate *priv;
+
+  priv = GARROW_DATA_TYPE_GET_PRIVATE(data_type);
+  return priv->data_type;
+}

http://git-wip-us.apache.org/repos/asf/arrow/blob/b77af1a1/c_glib/arrow-glib/basic-data-type.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/basic-data-type.h b/c_glib/arrow-glib/basic-data-type.h
new file mode 100644
index 0000000..d3d52c6
--- /dev/null
+++ b/c_glib/arrow-glib/basic-data-type.h
@@ -0,0 +1,954 @@
+/*
+ * 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/type.h>
+
+G_BEGIN_DECLS
+
+#define GARROW_TYPE_DATA_TYPE                   \
+  (garrow_data_type_get_type())
+#define GARROW_DATA_TYPE(obj)                           \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                    \
+                              GARROW_TYPE_DATA_TYPE,    \
+                              GArrowDataType))
+#define GARROW_DATA_TYPE_CLASS(klass)                   \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                     \
+                           GARROW_TYPE_DATA_TYPE,       \
+                           GArrowDataTypeClass))
+#define GARROW_IS_DATA_TYPE(obj)                        \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                    \
+                              GARROW_TYPE_DATA_TYPE))
+#define GARROW_IS_DATA_TYPE_CLASS(klass)                \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                     \
+                           GARROW_TYPE_DATA_TYPE))
+#define GARROW_DATA_TYPE_GET_CLASS(obj)                 \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                     \
+                             GARROW_TYPE_DATA_TYPE,     \
+                             GArrowDataTypeClass))
+
+typedef struct _GArrowDataType         GArrowDataType;
+typedef struct _GArrowDataTypeClass    GArrowDataTypeClass;
+
+/**
+ * GArrowDataType:
+ *
+ * It wraps `arrow::DataType`.
+ */
+struct _GArrowDataType
+{
+  /*< private >*/
+  GObject parent_instance;
+};
+
+struct _GArrowDataTypeClass
+{
+  GObjectClass parent_class;
+};
+
+GType      garrow_data_type_get_type  (void) G_GNUC_CONST;
+gboolean   garrow_data_type_equal     (GArrowDataType *data_type,
+                                       GArrowDataType *other_data_type);
+gchar     *garrow_data_type_to_string (GArrowDataType *data_type);
+GArrowType garrow_data_type_get_id    (GArrowDataType *data_type);
+
+
+#define GARROW_TYPE_NULL_DATA_TYPE              \
+  (garrow_null_data_type_get_type())
+#define GARROW_NULL_DATA_TYPE(obj)                              \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_NULL_DATA_TYPE,       \
+                              GArrowNullDataType))
+#define GARROW_NULL_DATA_TYPE_CLASS(klass)              \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                     \
+                           GARROW_TYPE_NULL_DATA_TYPE,  \
+                           GArrowNullDataTypeClass))
+#define GARROW_IS_NULL_DATA_TYPE(obj)                           \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_NULL_DATA_TYPE))
+#define GARROW_IS_NULL_DATA_TYPE_CLASS(klass)           \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                     \
+                           GARROW_TYPE_NULL_DATA_TYPE))
+#define GARROW_NULL_DATA_TYPE_GET_CLASS(obj)                    \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_NULL_DATA_TYPE,        \
+                             GArrowNullDataTypeClass))
+
+typedef struct _GArrowNullDataType         GArrowNullDataType;
+typedef struct _GArrowNullDataTypeClass    GArrowNullDataTypeClass;
+
+/**
+ * GArrowNullDataType:
+ *
+ * It wraps `arrow::NullType`.
+ */
+struct _GArrowNullDataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowNullDataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType               garrow_null_data_type_get_type (void) G_GNUC_CONST;
+GArrowNullDataType *garrow_null_data_type_new      (void);
+
+
+#define GARROW_TYPE_BOOLEAN_DATA_TYPE           \
+  (garrow_boolean_data_type_get_type())
+#define GARROW_BOOLEAN_DATA_TYPE(obj)                           \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_BOOLEAN_DATA_TYPE,    \
+                              GArrowBooleanDataType))
+#define GARROW_BOOLEAN_DATA_TYPE_CLASS(klass)                   \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_BOOLEAN_DATA_TYPE,       \
+                           GArrowBooleanDataTypeClass))
+#define GARROW_IS_BOOLEAN_DATA_TYPE(obj)                        \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_BOOLEAN_DATA_TYPE))
+#define GARROW_IS_BOOLEAN_DATA_TYPE_CLASS(klass)                \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_BOOLEAN_DATA_TYPE))
+#define GARROW_BOOLEAN_DATA_TYPE_GET_CLASS(obj)                 \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_BOOLEAN_DATA_TYPE,     \
+                             GArrowBooleanDataTypeClass))
+
+typedef struct _GArrowBooleanDataType         GArrowBooleanDataType;
+typedef struct _GArrowBooleanDataTypeClass    GArrowBooleanDataTypeClass;
+
+/**
+ * GArrowBooleanDataType:
+ *
+ * It wraps `arrow::BooleanType`.
+ */
+struct _GArrowBooleanDataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowBooleanDataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                  garrow_boolean_data_type_get_type (void) G_GNUC_CONST;
+GArrowBooleanDataType *garrow_boolean_data_type_new      (void);
+
+
+#define GARROW_TYPE_INT8_DATA_TYPE            \
+  (garrow_int8_data_type_get_type())
+#define GARROW_INT8_DATA_TYPE(obj)                            \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                          \
+                              GARROW_TYPE_INT8_DATA_TYPE,     \
+                              GArrowInt8DataType))
+#define GARROW_INT8_DATA_TYPE_CLASS(klass)                    \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                           \
+                           GARROW_TYPE_INT8_DATA_TYPE,        \
+                           GArrowInt8DataTypeClass))
+#define GARROW_IS_INT8_DATA_TYPE(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                          \
+                              GARROW_TYPE_INT8_DATA_TYPE))
+#define GARROW_IS_INT8_DATA_TYPE_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                           \
+                           GARROW_TYPE_INT8_DATA_TYPE))
+#define GARROW_INT8_DATA_TYPE_GET_CLASS(obj)                  \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                           \
+                             GARROW_TYPE_INT8_DATA_TYPE,      \
+                             GArrowInt8DataTypeClass))
+
+typedef struct _GArrowInt8DataType         GArrowInt8DataType;
+typedef struct _GArrowInt8DataTypeClass    GArrowInt8DataTypeClass;
+
+/**
+ * GArrowInt8DataType:
+ *
+ * It wraps `arrow::Int8Type`.
+ */
+struct _GArrowInt8DataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowInt8DataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_int8_data_type_get_type (void) G_GNUC_CONST;
+GArrowInt8DataType   *garrow_int8_data_type_new      (void);
+
+
+#define GARROW_TYPE_UINT8_DATA_TYPE            \
+  (garrow_uint8_data_type_get_type())
+#define GARROW_UINT8_DATA_TYPE(obj)                            \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                           \
+                              GARROW_TYPE_UINT8_DATA_TYPE,     \
+                              GArrowUInt8DataType))
+#define GARROW_UINT8_DATA_TYPE_CLASS(klass)                    \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                            \
+                           GARROW_TYPE_UINT8_DATA_TYPE,        \
+                           GArrowUInt8DataTypeClass))
+#define GARROW_IS_UINT8_DATA_TYPE(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                           \
+                              GARROW_TYPE_UINT8_DATA_TYPE))
+#define GARROW_IS_UINT8_DATA_TYPE_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                            \
+                           GARROW_TYPE_UINT8_DATA_TYPE))
+#define GARROW_UINT8_DATA_TYPE_GET_CLASS(obj)                  \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                            \
+                             GARROW_TYPE_UINT8_DATA_TYPE,      \
+                             GArrowUInt8DataTypeClass))
+
+typedef struct _GArrowUInt8DataType         GArrowUInt8DataType;
+typedef struct _GArrowUInt8DataTypeClass    GArrowUInt8DataTypeClass;
+
+/**
+ * GArrowUInt8DataType:
+ *
+ * It wraps `arrow::UInt8Type`.
+ */
+struct _GArrowUInt8DataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowUInt8DataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_uint8_data_type_get_type (void) G_GNUC_CONST;
+GArrowUInt8DataType  *garrow_uint8_data_type_new      (void);
+
+
+#define GARROW_TYPE_INT16_DATA_TYPE            \
+  (garrow_int16_data_type_get_type())
+#define GARROW_INT16_DATA_TYPE(obj)                            \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                           \
+                              GARROW_TYPE_INT16_DATA_TYPE,     \
+                              GArrowInt16DataType))
+#define GARROW_INT16_DATA_TYPE_CLASS(klass)                    \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                            \
+                           GARROW_TYPE_INT16_DATA_TYPE,        \
+                           GArrowInt16DataTypeClass))
+#define GARROW_IS_INT16_DATA_TYPE(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                           \
+                              GARROW_TYPE_INT16_DATA_TYPE))
+#define GARROW_IS_INT16_DATA_TYPE_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                            \
+                           GARROW_TYPE_INT16_DATA_TYPE))
+#define GARROW_INT16_DATA_TYPE_GET_CLASS(obj)                  \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                            \
+                             GARROW_TYPE_INT16_DATA_TYPE,      \
+                             GArrowInt16DataTypeClass))
+
+typedef struct _GArrowInt16DataType         GArrowInt16DataType;
+typedef struct _GArrowInt16DataTypeClass    GArrowInt16DataTypeClass;
+
+/**
+ * GArrowInt16DataType:
+ *
+ * It wraps `arrow::Int16Type`.
+ */
+struct _GArrowInt16DataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowInt16DataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_int16_data_type_get_type (void) G_GNUC_CONST;
+GArrowInt16DataType  *garrow_int16_data_type_new      (void);
+
+
+#define GARROW_TYPE_UINT16_DATA_TYPE            \
+  (garrow_uint16_data_type_get_type())
+#define GARROW_UINT16_DATA_TYPE(obj)                            \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_UINT16_DATA_TYPE,     \
+                              GArrowUInt16DataType))
+#define GARROW_UINT16_DATA_TYPE_CLASS(klass)                    \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_UINT16_DATA_TYPE,        \
+                           GArrowUInt16DataTypeClass))
+#define GARROW_IS_UINT16_DATA_TYPE(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_UINT16_DATA_TYPE))
+#define GARROW_IS_UINT16_DATA_TYPE_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_UINT16_DATA_TYPE))
+#define GARROW_UINT16_DATA_TYPE_GET_CLASS(obj)                  \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_UINT16_DATA_TYPE,      \
+                             GArrowUInt16DataTypeClass))
+
+typedef struct _GArrowUInt16DataType         GArrowUInt16DataType;
+typedef struct _GArrowUInt16DataTypeClass    GArrowUInt16DataTypeClass;
+
+/**
+ * GArrowUInt16DataType:
+ *
+ * It wraps `arrow::UInt16Type`.
+ */
+struct _GArrowUInt16DataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowUInt16DataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_uint16_data_type_get_type (void) G_GNUC_CONST;
+GArrowUInt16DataType *garrow_uint16_data_type_new      (void);
+
+
+#define GARROW_TYPE_INT32_DATA_TYPE            \
+  (garrow_int32_data_type_get_type())
+#define GARROW_INT32_DATA_TYPE(obj)                             \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_INT32_DATA_TYPE,      \
+                              GArrowInt32DataType))
+#define GARROW_INT32_DATA_TYPE_CLASS(klass)             \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                     \
+                           GARROW_TYPE_INT32_DATA_TYPE, \
+                           GArrowInt32DataTypeClass))
+#define GARROW_IS_INT32_DATA_TYPE(obj)                          \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_INT32_DATA_TYPE))
+#define GARROW_IS_INT32_DATA_TYPE_CLASS(klass)                  \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_INT32_DATA_TYPE))
+#define GARROW_INT32_DATA_TYPE_GET_CLASS(obj)                   \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_INT32_DATA_TYPE,       \
+                             GArrowInt32DataTypeClass))
+
+typedef struct _GArrowInt32DataType         GArrowInt32DataType;
+typedef struct _GArrowInt32DataTypeClass    GArrowInt32DataTypeClass;
+
+/**
+ * GArrowInt32DataType:
+ *
+ * It wraps `arrow::Int32Type`.
+ */
+struct _GArrowInt32DataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowInt32DataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_int32_data_type_get_type (void) G_GNUC_CONST;
+GArrowInt32DataType  *garrow_int32_data_type_new      (void);
+
+
+#define GARROW_TYPE_UINT32_DATA_TYPE            \
+  (garrow_uint32_data_type_get_type())
+#define GARROW_UINT32_DATA_TYPE(obj)                            \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_UINT32_DATA_TYPE,     \
+                              GArrowUInt32DataType))
+#define GARROW_UINT32_DATA_TYPE_CLASS(klass)                    \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_UINT32_DATA_TYPE,        \
+                           GArrowUInt32DataTypeClass))
+#define GARROW_IS_UINT32_DATA_TYPE(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_UINT32_DATA_TYPE))
+#define GARROW_IS_UINT32_DATA_TYPE_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_UINT32_DATA_TYPE))
+#define GARROW_UINT32_DATA_TYPE_GET_CLASS(obj)                  \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_UINT32_DATA_TYPE,      \
+                             GArrowUInt32DataTypeClass))
+
+typedef struct _GArrowUInt32DataType         GArrowUInt32DataType;
+typedef struct _GArrowUInt32DataTypeClass    GArrowUInt32DataTypeClass;
+
+/**
+ * GArrowUInt32DataType:
+ *
+ * It wraps `arrow::UInt32Type`.
+ */
+struct _GArrowUInt32DataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowUInt32DataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_uint32_data_type_get_type (void) G_GNUC_CONST;
+GArrowUInt32DataType *garrow_uint32_data_type_new      (void);
+
+
+#define GARROW_TYPE_INT64_DATA_TYPE            \
+  (garrow_int64_data_type_get_type())
+#define GARROW_INT64_DATA_TYPE(obj)                             \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_INT64_DATA_TYPE,      \
+                              GArrowInt64DataType))
+#define GARROW_INT64_DATA_TYPE_CLASS(klass)             \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                     \
+                           GARROW_TYPE_INT64_DATA_TYPE, \
+                           GArrowInt64DataTypeClass))
+#define GARROW_IS_INT64_DATA_TYPE(obj)                          \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_INT64_DATA_TYPE))
+#define GARROW_IS_INT64_DATA_TYPE_CLASS(klass)                  \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_INT64_DATA_TYPE))
+#define GARROW_INT64_DATA_TYPE_GET_CLASS(obj)                   \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_INT64_DATA_TYPE,       \
+                             GArrowInt64DataTypeClass))
+
+typedef struct _GArrowInt64DataType         GArrowInt64DataType;
+typedef struct _GArrowInt64DataTypeClass    GArrowInt64DataTypeClass;
+
+/**
+ * GArrowInt64DataType:
+ *
+ * It wraps `arrow::Int64Type`.
+ */
+struct _GArrowInt64DataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowInt64DataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_int64_data_type_get_type (void) G_GNUC_CONST;
+GArrowInt64DataType  *garrow_int64_data_type_new      (void);
+
+
+#define GARROW_TYPE_UINT64_DATA_TYPE            \
+  (garrow_uint64_data_type_get_type())
+#define GARROW_UINT64_DATA_TYPE(obj)                            \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_UINT64_DATA_TYPE,     \
+                              GArrowUInt64DataType))
+#define GARROW_UINT64_DATA_TYPE_CLASS(klass)                    \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_UINT64_DATA_TYPE,        \
+                           GArrowUInt64DataTypeClass))
+#define GARROW_IS_UINT64_DATA_TYPE(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_UINT64_DATA_TYPE))
+#define GARROW_IS_UINT64_DATA_TYPE_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_UINT64_DATA_TYPE))
+#define GARROW_UINT64_DATA_TYPE_GET_CLASS(obj)                  \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_UINT64_DATA_TYPE,      \
+                             GArrowUInt64DataTypeClass))
+
+typedef struct _GArrowUInt64DataType         GArrowUInt64DataType;
+typedef struct _GArrowUInt64DataTypeClass    GArrowUInt64DataTypeClass;
+
+/**
+ * GArrowUInt64DataType:
+ *
+ * It wraps `arrow::UInt64Type`.
+ */
+struct _GArrowUInt64DataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowUInt64DataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_uint64_data_type_get_type (void) G_GNUC_CONST;
+GArrowUInt64DataType *garrow_uint64_data_type_new      (void);
+
+
+#define GARROW_TYPE_FLOAT_DATA_TYPE           \
+  (garrow_float_data_type_get_type())
+#define GARROW_FLOAT_DATA_TYPE(obj)                           \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                          \
+                              GARROW_TYPE_FLOAT_DATA_TYPE,    \
+                              GArrowFloatDataType))
+#define GARROW_FLOAT_DATA_TYPE_CLASS(klass)                   \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                           \
+                           GARROW_TYPE_FLOAT_DATA_TYPE,       \
+                           GArrowFloatDataTypeClass))
+#define GARROW_IS_FLOAT_DATA_TYPE(obj)                        \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                          \
+                              GARROW_TYPE_FLOAT_DATA_TYPE))
+#define GARROW_IS_FLOAT_DATA_TYPE_CLASS(klass)                \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                           \
+                           GARROW_TYPE_FLOAT_DATA_TYPE))
+#define GARROW_FLOAT_DATA_TYPE_GET_CLASS(obj)                 \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                           \
+                             GARROW_TYPE_FLOAT_DATA_TYPE,     \
+                             GArrowFloatDataTypeClass))
+
+typedef struct _GArrowFloatDataType         GArrowFloatDataType;
+typedef struct _GArrowFloatDataTypeClass    GArrowFloatDataTypeClass;
+
+/**
+ * GArrowFloatDataType:
+ *
+ * It wraps `arrow::FloatType`.
+ */
+struct _GArrowFloatDataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowFloatDataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                garrow_float_data_type_get_type (void) G_GNUC_CONST;
+GArrowFloatDataType *garrow_float_data_type_new      (void);
+
+
+#define GARROW_TYPE_DOUBLE_DATA_TYPE           \
+  (garrow_double_data_type_get_type())
+#define GARROW_DOUBLE_DATA_TYPE(obj)                            \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_DOUBLE_DATA_TYPE,     \
+                              GArrowDoubleDataType))
+#define GARROW_DOUBLE_DATA_TYPE_CLASS(klass)                    \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_DOUBLE_DATA_TYPE,        \
+                           GArrowDoubleDataTypeClass))
+#define GARROW_IS_DOUBLE_DATA_TYPE(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_DOUBLE_DATA_TYPE))
+#define GARROW_IS_DOUBLE_DATA_TYPE_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_DOUBLE_DATA_TYPE))
+#define GARROW_DOUBLE_DATA_TYPE_GET_CLASS(obj)                  \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_DOUBLE_DATA_TYPE,      \
+                             GArrowDoubleDataTypeClass))
+
+typedef struct _GArrowDoubleDataType         GArrowDoubleDataType;
+typedef struct _GArrowDoubleDataTypeClass    GArrowDoubleDataTypeClass;
+
+/**
+ * GArrowDoubleDataType:
+ *
+ * It wraps `arrow::DoubleType`.
+ */
+struct _GArrowDoubleDataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowDoubleDataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_double_data_type_get_type (void) G_GNUC_CONST;
+GArrowDoubleDataType *garrow_double_data_type_new      (void);
+
+
+#define GARROW_TYPE_BINARY_DATA_TYPE            \
+  (garrow_binary_data_type_get_type())
+#define GARROW_BINARY_DATA_TYPE(obj)                            \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_BINARY_DATA_TYPE,     \
+                              GArrowBinaryDataType))
+#define GARROW_BINARY_DATA_TYPE_CLASS(klass)                    \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_BINARY_DATA_TYPE,        \
+                           GArrowBinaryDataTypeClass))
+#define GARROW_IS_BINARY_DATA_TYPE(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_BINARY_DATA_TYPE))
+#define GARROW_IS_BINARY_DATA_TYPE_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_BINARY_DATA_TYPE))
+#define GARROW_BINARY_DATA_TYPE_GET_CLASS(obj)                  \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_BINARY_DATA_TYPE,      \
+                             GArrowBinaryDataTypeClass))
+
+typedef struct _GArrowBinaryDataType         GArrowBinaryDataType;
+typedef struct _GArrowBinaryDataTypeClass    GArrowBinaryDataTypeClass;
+
+/**
+ * GArrowBinaryDataType:
+ *
+ * It wraps `arrow::BinaryType`.
+ */
+struct _GArrowBinaryDataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowBinaryDataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_binary_data_type_get_type (void) G_GNUC_CONST;
+GArrowBinaryDataType *garrow_binary_data_type_new      (void);
+
+
+#define GARROW_TYPE_STRING_DATA_TYPE            \
+  (garrow_string_data_type_get_type())
+#define GARROW_STRING_DATA_TYPE(obj)                           \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                           \
+                              GARROW_TYPE_STRING_DATA_TYPE,    \
+                              GArrowStringDataType))
+#define GARROW_STRING_DATA_TYPE_CLASS(klass)                   \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                            \
+                           GARROW_TYPE_STRING_DATA_TYPE,       \
+                           GArrowStringDataTypeClass))
+#define GARROW_IS_STRING_DATA_TYPE(obj)                        \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                           \
+                              GARROW_TYPE_STRING_DATA_TYPE))
+#define GARROW_IS_STRING_DATA_TYPE_CLASS(klass)                \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                            \
+                           GARROW_TYPE_STRING_DATA_TYPE))
+#define GARROW_STRING_DATA_TYPE_GET_CLASS(obj)                 \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                            \
+                             GARROW_TYPE_STRING_DATA_TYPE,     \
+                             GArrowStringDataTypeClass))
+
+typedef struct _GArrowStringDataType         GArrowStringDataType;
+typedef struct _GArrowStringDataTypeClass    GArrowStringDataTypeClass;
+
+/**
+ * GArrowStringDataType:
+ *
+ * It wraps `arrow::StringType`.
+ */
+struct _GArrowStringDataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowStringDataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_string_data_type_get_type (void) G_GNUC_CONST;
+GArrowStringDataType *garrow_string_data_type_new      (void);
+
+
+#define GARROW_TYPE_DATE32_DATA_TYPE           \
+  (garrow_date32_data_type_get_type())
+#define GARROW_DATE32_DATA_TYPE(obj)                            \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_DATE32_DATA_TYPE,     \
+                              GArrowDate32DataType))
+#define GARROW_DATE32_DATA_TYPE_CLASS(klass)                    \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_DATE32_DATA_TYPE,        \
+                           GArrowDate32DataTypeClass))
+#define GARROW_IS_DATE32_DATA_TYPE(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_DATE32_DATA_TYPE))
+#define GARROW_IS_DATE32_DATA_TYPE_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_DATE32_DATA_TYPE))
+#define GARROW_DATE32_DATA_TYPE_GET_CLASS(obj)                  \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_DATE32_DATA_TYPE,      \
+                             GArrowDate32DataTypeClass))
+
+typedef struct _GArrowDate32DataType         GArrowDate32DataType;
+typedef struct _GArrowDate32DataTypeClass    GArrowDate32DataTypeClass;
+
+/**
+ * GArrowDate32DataType:
+ *
+ * It wraps `arrow::Date32Type`.
+ */
+struct _GArrowDate32DataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowDate32DataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_date32_data_type_get_type (void) G_GNUC_CONST;
+GArrowDate32DataType *garrow_date32_data_type_new      (void);
+
+
+#define GARROW_TYPE_DATE64_DATA_TYPE           \
+  (garrow_date64_data_type_get_type())
+#define GARROW_DATE64_DATA_TYPE(obj)                            \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_DATE64_DATA_TYPE,     \
+                              GArrowDate64DataType))
+#define GARROW_DATE64_DATA_TYPE_CLASS(klass)                    \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_DATE64_DATA_TYPE,        \
+                           GArrowDate64DataTypeClass))
+#define GARROW_IS_DATE64_DATA_TYPE(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_DATE64_DATA_TYPE))
+#define GARROW_IS_DATE64_DATA_TYPE_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_DATE64_DATA_TYPE))
+#define GARROW_DATE64_DATA_TYPE_GET_CLASS(obj)                  \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_DATE64_DATA_TYPE,      \
+                             GArrowDate64DataTypeClass))
+
+typedef struct _GArrowDate64DataType         GArrowDate64DataType;
+typedef struct _GArrowDate64DataTypeClass    GArrowDate64DataTypeClass;
+
+/**
+ * GArrowDate64DataType:
+ *
+ * It wraps `arrow::Date64Type`.
+ */
+struct _GArrowDate64DataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowDate64DataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_date64_data_type_get_type (void) G_GNUC_CONST;
+GArrowDate64DataType *garrow_date64_data_type_new      (void);
+
+
+#define GARROW_TYPE_TIMESTAMP_DATA_TYPE         \
+  (garrow_timestamp_data_type_get_type())
+#define GARROW_TIMESTAMP_DATA_TYPE(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_TIMESTAMP_DATA_TYPE,  \
+                              GArrowTimestampDataType))
+#define GARROW_TIMESTAMP_DATA_TYPE_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_TIMESTAMP_DATA_TYPE,     \
+                           GArrowTimestampDataTypeClass))
+#define GARROW_IS_TIMESTAMP_DATA_TYPE(obj)                      \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_TIMESTAMP_DATA_TYPE))
+#define GARROW_IS_TIMESTAMP_DATA_TYPE_CLASS(klass)              \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_TIMESTAMP_DATA_TYPE))
+#define GARROW_TIMESTAMP_DATA_TYPE_GET_CLASS(obj)               \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_TIMESTAMP_DATA_TYPE,   \
+                             GArrowTimestampDataTypeClass))
+
+typedef struct _GArrowTimestampDataType         GArrowTimestampDataType;
+typedef struct _GArrowTimestampDataTypeClass    GArrowTimestampDataTypeClass;
+
+/**
+ * GArrowTimestampDataType:
+ *
+ * It wraps `arrow::TimestampType`.
+ */
+struct _GArrowTimestampDataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowTimestampDataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_timestamp_data_type_get_type (void) G_GNUC_CONST;
+GArrowTimestampDataType *garrow_timestamp_data_type_new   (GArrowTimeUnit unit);
+
+
+#define GARROW_TYPE_TIME_DATA_TYPE              \
+  (garrow_time_data_type_get_type())
+#define GARROW_TIME_DATA_TYPE(obj)                              \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_TIME_DATA_TYPE,       \
+                              GArrowTimeDataType))
+#define GARROW_TIME_DATA_TYPE_CLASS(klass)              \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                     \
+                           GARROW_TYPE_TIME_DATA_TYPE,  \
+                           GArrowTimeDataTypeClass))
+#define GARROW_IS_TIME_DATA_TYPE(obj)                           \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_TIME_DATA_TYPE))
+#define GARROW_IS_TIME_DATA_TYPE_CLASS(klass)           \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                     \
+                           GARROW_TYPE_TIME_DATA_TYPE))
+#define GARROW_TIME_DATA_TYPE_GET_CLASS(obj)                    \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_TIME_DATA_TYPE,        \
+                             GArrowTimeDataTypeClass))
+
+typedef struct _GArrowTimeDataType         GArrowTimeDataType;
+typedef struct _GArrowTimeDataTypeClass    GArrowTimeDataTypeClass;
+
+/**
+ * GArrowTimeDataType:
+ *
+ * It wraps `arrow::TimeType`.
+ */
+struct _GArrowTimeDataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowTimeDataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType          garrow_time_data_type_get_type (void) G_GNUC_CONST;
+GArrowTimeUnit garrow_time_data_type_get_unit (GArrowTimeDataType *time_data_type);
+
+
+#define GARROW_TYPE_TIME32_DATA_TYPE           \
+  (garrow_time32_data_type_get_type())
+#define GARROW_TIME32_DATA_TYPE(obj)                            \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_TIME32_DATA_TYPE,     \
+                              GArrowTime32DataType))
+#define GARROW_TIME32_DATA_TYPE_CLASS(klass)                    \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_TIME32_DATA_TYPE,        \
+                           GArrowTime32DataTypeClass))
+#define GARROW_IS_TIME32_DATA_TYPE(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_TIME32_DATA_TYPE))
+#define GARROW_IS_TIME32_DATA_TYPE_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_TIME32_DATA_TYPE))
+#define GARROW_TIME32_DATA_TYPE_GET_CLASS(obj)                  \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_TIME32_DATA_TYPE,      \
+                             GArrowTime32DataTypeClass))
+
+typedef struct _GArrowTime32DataType         GArrowTime32DataType;
+typedef struct _GArrowTime32DataTypeClass    GArrowTime32DataTypeClass;
+
+/**
+ * GArrowTime32DataType:
+ *
+ * It wraps `arrow::Time32Type`.
+ */
+struct _GArrowTime32DataType
+{
+  /*< private >*/
+  GArrowTimeDataType parent_instance;
+};
+
+struct _GArrowTime32DataTypeClass
+{
+  GArrowTimeDataTypeClass parent_class;
+};
+
+GType                 garrow_time32_data_type_get_type (void) G_GNUC_CONST;
+GArrowTime32DataType *garrow_time32_data_type_new      (GArrowTimeUnit unit,
+                                                        GError **error);
+
+
+#define GARROW_TYPE_TIME64_DATA_TYPE           \
+  (garrow_time64_data_type_get_type())
+#define GARROW_TIME64_DATA_TYPE(obj)                            \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_TIME64_DATA_TYPE,     \
+                              GArrowTime64DataType))
+#define GARROW_TIME64_DATA_TYPE_CLASS(klass)                    \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_TIME64_DATA_TYPE,        \
+                           GArrowTime64DataTypeClass))
+#define GARROW_IS_TIME64_DATA_TYPE(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_TIME64_DATA_TYPE))
+#define GARROW_IS_TIME64_DATA_TYPE_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_TIME64_DATA_TYPE))
+#define GARROW_TIME64_DATA_TYPE_GET_CLASS(obj)                  \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_TIME64_DATA_TYPE,      \
+                             GArrowTime64DataTypeClass))
+
+typedef struct _GArrowTime64DataType         GArrowTime64DataType;
+typedef struct _GArrowTime64DataTypeClass    GArrowTime64DataTypeClass;
+
+/**
+ * GArrowTime64DataType:
+ *
+ * It wraps `arrow::Time64Type`.
+ */
+struct _GArrowTime64DataType
+{
+  /*< private >*/
+  GArrowTimeDataType parent_instance;
+};
+
+struct _GArrowTime64DataTypeClass
+{
+  GArrowTimeDataTypeClass parent_class;
+};
+
+GType                 garrow_time64_data_type_get_type (void) G_GNUC_CONST;
+GArrowTime64DataType *garrow_time64_data_type_new      (GArrowTimeUnit unit,
+                                                        GError **error);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/b77af1a1/c_glib/arrow-glib/basic-data-type.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/basic-data-type.hpp b/c_glib/arrow-glib/basic-data-type.hpp
new file mode 100644
index 0000000..aa95cec
--- /dev/null
+++ b/c_glib/arrow-glib/basic-data-type.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/basic-data-type.h>
+
+GArrowDataType *garrow_data_type_new_raw(std::shared_ptr<arrow::DataType> *arrow_data_type);
+std::shared_ptr<arrow::DataType> garrow_data_type_get_raw(GArrowDataType *data_type);

http://git-wip-us.apache.org/repos/asf/arrow/blob/b77af1a1/c_glib/arrow-glib/composite-data-type.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/composite-data-type.cpp b/c_glib/arrow-glib/composite-data-type.cpp
new file mode 100644
index 0000000..ce3d78c
--- /dev/null
+++ b/c_glib/arrow-glib/composite-data-type.cpp
@@ -0,0 +1,136 @@
+/*
+ * 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/enums.h>
+#include <arrow-glib/error.hpp>
+#include <arrow-glib/field.hpp>
+#include <arrow-glib/type.hpp>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: composite-data-type
+ * @section_id: composite-data-type-classes
+ * @title: Composite data type classes
+ * @include: arrow-glib/arrow-glib.h
+ *
+ * #GArrowListDataType is a class for list data type.
+ *
+ * #GArrowStructDataType is a class for struct data type.
+ */
+
+G_DEFINE_TYPE(GArrowListDataType,                \
+              garrow_list_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_list_data_type_init(GArrowListDataType *object)
+{
+}
+
+static void
+garrow_list_data_type_class_init(GArrowListDataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_list_data_type_new:
+ * @field: The field of elements
+ *
+ * Returns: The newly created list data type.
+ */
+GArrowListDataType *
+garrow_list_data_type_new(GArrowField *field)
+{
+  auto arrow_field = garrow_field_get_raw(field);
+  auto arrow_data_type =
+    std::make_shared<arrow::ListType>(arrow_field);
+
+  GArrowListDataType *data_type =
+    GARROW_LIST_DATA_TYPE(g_object_new(GARROW_TYPE_LIST_DATA_TYPE,
+                                       "data-type", &arrow_data_type,
+                                       NULL));
+  return data_type;
+}
+
+/**
+ * garrow_list_data_type_get_value_field:
+ * @list_data_type: A #GArrowListDataType.
+ *
+ * Returns: (transfer full): The field of value.
+ */
+GArrowField *
+garrow_list_data_type_get_value_field(GArrowListDataType *list_data_type)
+{
+  auto arrow_data_type =
+    garrow_data_type_get_raw(GARROW_DATA_TYPE(list_data_type));
+  auto arrow_list_data_type =
+    static_cast<arrow::ListType *>(arrow_data_type.get());
+
+  auto arrow_field = arrow_list_data_type->value_field();
+  auto field = garrow_field_new_raw(&arrow_field);
+
+  return field;
+}
+
+
+G_DEFINE_TYPE(GArrowStructDataType,                \
+              garrow_struct_data_type,             \
+              GARROW_TYPE_DATA_TYPE)
+
+static void
+garrow_struct_data_type_init(GArrowStructDataType *object)
+{
+}
+
+static void
+garrow_struct_data_type_class_init(GArrowStructDataTypeClass *klass)
+{
+}
+
+/**
+ * garrow_struct_data_type_new:
+ * @fields: (element-type GArrowField): The fields of the struct.
+ *
+ * Returns: The newly created struct data type.
+ */
+GArrowStructDataType *
+garrow_struct_data_type_new(GList *fields)
+{
+  std::vector<std::shared_ptr<arrow::Field>> arrow_fields;
+  for (GList *node = fields; node; node = g_list_next(node)) {
+    auto field = GARROW_FIELD(node->data);
+    auto arrow_field = garrow_field_get_raw(field);
+    arrow_fields.push_back(arrow_field);
+  }
+
+  auto arrow_data_type = std::make_shared<arrow::StructType>(arrow_fields);
+  GArrowStructDataType *data_type =
+    GARROW_STRUCT_DATA_TYPE(g_object_new(GARROW_TYPE_STRUCT_DATA_TYPE,
+                                         "data-type", &arrow_data_type,
+                                         NULL));
+  return data_type;
+}
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/b77af1a1/c_glib/arrow-glib/composite-data-type.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/composite-data-type.h b/c_glib/arrow-glib/composite-data-type.h
new file mode 100644
index 0000000..9dac5bd
--- /dev/null
+++ b/c_glib/arrow-glib/composite-data-type.h
@@ -0,0 +1,115 @@
+/*
+ * 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/basic-data-type.h>
+#include <arrow-glib/field.h>
+
+G_BEGIN_DECLS
+
+#define GARROW_TYPE_LIST_DATA_TYPE              \
+  (garrow_list_data_type_get_type())
+#define GARROW_LIST_DATA_TYPE(obj)                              \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_LIST_DATA_TYPE,       \
+                              GArrowListDataType))
+#define GARROW_LIST_DATA_TYPE_CLASS(klass)              \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                     \
+                           GARROW_TYPE_LIST_DATA_TYPE,  \
+                           GArrowListDataTypeClass))
+#define GARROW_IS_LIST_DATA_TYPE(obj)                           \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_LIST_DATA_TYPE))
+#define GARROW_IS_LIST_DATA_TYPE_CLASS(klass)           \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                     \
+                           GARROW_TYPE_LIST_DATA_TYPE))
+#define GARROW_LIST_DATA_TYPE_GET_CLASS(obj)                    \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_LIST_DATA_TYPE,        \
+                             GArrowListDataTypeClass))
+
+typedef struct _GArrowListDataType         GArrowListDataType;
+typedef struct _GArrowListDataTypeClass    GArrowListDataTypeClass;
+
+/**
+ * GArrowListDataType:
+ *
+ * It wraps `arrow::ListType`.
+ */
+struct _GArrowListDataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowListDataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType               garrow_list_data_type_get_type (void) G_GNUC_CONST;
+GArrowListDataType *garrow_list_data_type_new      (GArrowField *field);
+GArrowField *garrow_list_data_type_get_value_field (GArrowListDataType *list_data_type);
+
+
+#define GARROW_TYPE_STRUCT_DATA_TYPE            \
+  (garrow_struct_data_type_get_type())
+#define GARROW_STRUCT_DATA_TYPE(obj)                            \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_STRUCT_DATA_TYPE,     \
+                              GArrowStructDataType))
+#define GARROW_STRUCT_DATA_TYPE_CLASS(klass)                    \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_STRUCT_DATA_TYPE,        \
+                           GArrowStructDataTypeClass))
+#define GARROW_IS_STRUCT_DATA_TYPE(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_STRUCT_DATA_TYPE))
+#define GARROW_IS_STRUCT_DATA_TYPE_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_STRUCT_DATA_TYPE))
+#define GARROW_STRUCT_DATA_TYPE_GET_CLASS(obj)                  \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_STRUCT_DATA_TYPE,      \
+                             GArrowStructDataTypeClass))
+
+typedef struct _GArrowStructDataType         GArrowStructDataType;
+typedef struct _GArrowStructDataTypeClass    GArrowStructDataTypeClass;
+
+/**
+ * GArrowStructDataType:
+ *
+ * It wraps `arrow::StructType`.
+ */
+struct _GArrowStructDataType
+{
+  /*< private >*/
+  GArrowDataType parent_instance;
+};
+
+struct _GArrowStructDataTypeClass
+{
+  GArrowDataTypeClass parent_class;
+};
+
+GType                 garrow_struct_data_type_get_type (void) G_GNUC_CONST;
+GArrowStructDataType *garrow_struct_data_type_new      (GList *fields);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/b77af1a1/c_glib/arrow-glib/compute.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/compute.cpp b/c_glib/arrow-glib/compute.cpp
index f7a48d1..9134aa6 100644
--- a/c_glib/arrow-glib/compute.cpp
+++ b/c_glib/arrow-glib/compute.cpp
@@ -28,7 +28,7 @@ G_BEGIN_DECLS
 /**
  * SECTION: compute
  * @section_id: compute-classes
- * @title: Compute classes
+ * @title: Classes for computation
  * @include: arrow-glib/arrow-glib.h
  *
  * #GArrowCastOptions is a class to custom garrow_array_cast().


Mime
View raw message