arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject [7/9] arrow git commit: ARROW-631: [GLib] Import
Date Fri, 17 Mar 2017 01:09:54 GMT
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/field.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/field.cpp b/c_glib/arrow-glib/field.cpp
new file mode 100644
index 0000000..0dcaf0a
--- /dev/null
+++ b/c_glib/arrow-glib/field.cpp
@@ -0,0 +1,250 @@
+/*
+ * 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/field.hpp>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: field
+ * @short_description: Field class
+ *
+ * #GArrowField is a class for field. Field is metadata of a
+ * column. It has name, data type (#GArrowDataType) and nullable
+ * information of the column.
+ */
+
+typedef struct GArrowFieldPrivate_ {
+  std::shared_ptr<arrow::Field> field;
+} GArrowFieldPrivate;
+
+enum {
+  PROP_0,
+  PROP_FIELD
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE(GArrowField,
+                           garrow_field,
+                           G_TYPE_OBJECT)
+
+#define GARROW_FIELD_GET_PRIVATE(obj)               \
+  (G_TYPE_INSTANCE_GET_PRIVATE((obj),               \
+                               GARROW_TYPE_FIELD,   \
+                               GArrowFieldPrivate))
+
+static void
+garrow_field_finalize(GObject *object)
+{
+  GArrowFieldPrivate *priv;
+
+  priv = GARROW_FIELD_GET_PRIVATE(object);
+
+  priv->field = nullptr;
+
+  G_OBJECT_CLASS(garrow_field_parent_class)->finalize(object);
+}
+
+static void
+garrow_field_set_property(GObject *object,
+                          guint prop_id,
+                          const GValue *value,
+                          GParamSpec *pspec)
+{
+  GArrowFieldPrivate *priv;
+
+  priv = GARROW_FIELD_GET_PRIVATE(object);
+
+  switch (prop_id) {
+  case PROP_FIELD:
+    priv->field =
+      *static_cast<std::shared_ptr<arrow::Field> *>(g_value_get_pointer(value));
+    break;
+  default:
+    G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+    break;
+  }
+}
+
+static void
+garrow_field_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_field_init(GArrowField *object)
+{
+}
+
+static void
+garrow_field_class_init(GArrowFieldClass *klass)
+{
+  GObjectClass *gobject_class;
+  GParamSpec *spec;
+
+  gobject_class = G_OBJECT_CLASS(klass);
+
+  gobject_class->finalize     = garrow_field_finalize;
+  gobject_class->set_property = garrow_field_set_property;
+  gobject_class->get_property = garrow_field_get_property;
+
+  spec = g_param_spec_pointer("field",
+                              "Field",
+                              "The raw std::shared<arrow::Field> *",
+                              static_cast<GParamFlags>(G_PARAM_WRITABLE |
+                                                       G_PARAM_CONSTRUCT_ONLY));
+  g_object_class_install_property(gobject_class, PROP_FIELD, spec);
+}
+
+/**
+ * garrow_field_new:
+ * @name: The name of the field.
+ * @data_type: The data type of the field.
+ *
+ * Returns: A newly created #GArrowField.
+ */
+GArrowField *
+garrow_field_new(const gchar *name,
+                 GArrowDataType *data_type)
+{
+  auto arrow_field =
+    std::make_shared<arrow::Field>(name,
+                                   garrow_data_type_get_raw(data_type));
+  return garrow_field_new_raw(&arrow_field);
+}
+
+/**
+ * garrow_field_new_full:
+ * @name: The name of the field.
+ * @data_type: The data type of the field.
+ * @nullable: Whether null may be included or not.
+ *
+ * Returns: A newly created #GArrowField.
+ */
+GArrowField *
+garrow_field_new_full(const gchar *name,
+                      GArrowDataType *data_type,
+                      gboolean nullable)
+{
+  auto arrow_field =
+    std::make_shared<arrow::Field>(name,
+                                   garrow_data_type_get_raw(data_type),
+                                   nullable);
+  return garrow_field_new_raw(&arrow_field);
+}
+
+/**
+ * garrow_field_get_name:
+ * @field: A #GArrowField.
+ *
+ * Returns: The name of the field.
+ */
+const gchar *
+garrow_field_get_name(GArrowField *field)
+{
+  const auto arrow_field = garrow_field_get_raw(field);
+  return arrow_field->name.c_str();
+}
+
+/**
+ * garrow_field_get_data_type:
+ * @field: A #GArrowField.
+ *
+ * Returns: (transfer full): The data type of the field.
+ */
+GArrowDataType *
+garrow_field_get_data_type(GArrowField *field)
+{
+  const auto arrow_field = garrow_field_get_raw(field);
+  return garrow_data_type_new_raw(&arrow_field->type);
+}
+
+/**
+ * garrow_field_is_nullable:
+ * @field: A #GArrowField.
+ *
+ * Returns: Whether the filed may include null or not.
+ */
+gboolean
+garrow_field_is_nullable(GArrowField *field)
+{
+  const auto arrow_field = garrow_field_get_raw(field);
+  return arrow_field->nullable;
+}
+
+/**
+ * garrow_field_equal:
+ * @field: A #GArrowField.
+ * @other_field: A #GArrowField.
+ *
+ * Returns: Whether they are equal or not.
+ */
+gboolean
+garrow_field_equal(GArrowField *field,
+                   GArrowField *other_field)
+{
+  const auto arrow_field = garrow_field_get_raw(field);
+  const auto arrow_other_field = garrow_field_get_raw(other_field);
+  return arrow_field->Equals(arrow_other_field);
+}
+
+/**
+ * garrow_field_to_string:
+ * @field: A #GArrowField.
+ *
+ * Returns: The string representation of the field.
+ */
+gchar *
+garrow_field_to_string(GArrowField *field)
+{
+  const auto arrow_field = garrow_field_get_raw(field);
+  return g_strdup(arrow_field->ToString().c_str());
+}
+
+G_END_DECLS
+
+GArrowField *
+garrow_field_new_raw(std::shared_ptr<arrow::Field> *arrow_field)
+{
+  auto field = GARROW_FIELD(g_object_new(GARROW_TYPE_FIELD,
+                                         "field", arrow_field,
+                                         NULL));
+  return field;
+}
+
+std::shared_ptr<arrow::Field>
+garrow_field_get_raw(GArrowField *field)
+{
+  GArrowFieldPrivate *priv;
+
+  priv = GARROW_FIELD_GET_PRIVATE(field);
+  return priv->field;
+}

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/field.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/field.h b/c_glib/arrow-glib/field.h
new file mode 100644
index 0000000..e724dce
--- /dev/null
+++ b/c_glib/arrow-glib/field.h
@@ -0,0 +1,83 @@
+/*
+ * 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/data-type.h>
+
+G_BEGIN_DECLS
+
+#define GARROW_TYPE_FIELD                       \
+  (garrow_field_get_type())
+#define GARROW_FIELD(obj)                               \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                    \
+                              GARROW_TYPE_FIELD,        \
+                              GArrowField))
+#define GARROW_FIELD_CLASS(klass)               \
+  (G_TYPE_CHECK_CLASS_CAST((klass),             \
+                           GARROW_TYPE_FIELD,   \
+                           GArrowFieldClass))
+#define GARROW_IS_FIELD(obj)                            \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                    \
+                              GARROW_TYPE_FIELD))
+#define GARROW_IS_FIELD_CLASS(klass)            \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),             \
+                           GARROW_TYPE_FIELD))
+#define GARROW_FIELD_GET_CLASS(obj)             \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),             \
+                             GARROW_TYPE_FIELD, \
+                             GArrowFieldClass))
+
+typedef struct _GArrowField         GArrowField;
+typedef struct _GArrowFieldClass    GArrowFieldClass;
+
+/**
+ * GArrowField:
+ *
+ * It wraps `arrow::Field`.
+ */
+struct _GArrowField
+{
+  /*< private >*/
+  GObject parent_instance;
+};
+
+struct _GArrowFieldClass
+{
+  GObjectClass parent_class;
+};
+
+GType           garrow_field_get_type      (void) G_GNUC_CONST;
+
+GArrowField    *garrow_field_new           (const gchar *name,
+                                            GArrowDataType *data_type);
+GArrowField    *garrow_field_new_full      (const gchar *name,
+                                            GArrowDataType *data_type,
+                                            gboolean nullable);
+
+const gchar    *garrow_field_get_name      (GArrowField *field);
+GArrowDataType *garrow_field_get_data_type (GArrowField *field);
+gboolean        garrow_field_is_nullable   (GArrowField *field);
+
+gboolean        garrow_field_equal         (GArrowField *field,
+                                            GArrowField *other_field);
+
+gchar          *garrow_field_to_string     (GArrowField *field);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/field.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/field.hpp b/c_glib/arrow-glib/field.hpp
new file mode 100644
index 0000000..e130ad5
--- /dev/null
+++ b/c_glib/arrow-glib/field.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/field.h>
+
+GArrowField *garrow_field_new_raw(std::shared_ptr<arrow::Field> *arrow_field);
+std::shared_ptr<arrow::Field> garrow_field_get_raw(GArrowField *field);

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/float-array-builder.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/float-array-builder.cpp b/c_glib/arrow-glib/float-array-builder.cpp
new file mode 100644
index 0000000..77a9a0b
--- /dev/null
+++ b/c_glib/arrow-glib/float-array-builder.cpp
@@ -0,0 +1,120 @@
+/*
+ * 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/error.hpp>
+#include <arrow-glib/float-array-builder.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: float-array-builder
+ * @short_description: 32-bit floating point array builder class
+ *
+ * #GArrowFloatArrayBuilder is the class to creating a new
+ * #GArrowFloatArray.
+ */
+
+G_DEFINE_TYPE(GArrowFloatArrayBuilder,
+              garrow_float_array_builder,
+              GARROW_TYPE_ARRAY_BUILDER)
+
+static void
+garrow_float_array_builder_init(GArrowFloatArrayBuilder *builder)
+{
+}
+
+static void
+garrow_float_array_builder_class_init(GArrowFloatArrayBuilderClass *klass)
+{
+}
+
+/**
+ * garrow_float_array_builder_new:
+ *
+ * Returns: A newly created #GArrowFloatArrayBuilder.
+ */
+GArrowFloatArrayBuilder *
+garrow_float_array_builder_new(void)
+{
+  auto memory_pool = arrow::default_memory_pool();
+  auto arrow_builder =
+    std::make_shared<arrow::FloatBuilder>(memory_pool, arrow::float32());
+  auto builder =
+    GARROW_FLOAT_ARRAY_BUILDER(g_object_new(GARROW_TYPE_FLOAT_ARRAY_BUILDER,
+                                            "array-builder", &arrow_builder,
+                                            NULL));
+  return builder;
+}
+
+/**
+ * garrow_float_array_builder_append:
+ * @builder: A #GArrowFloatArrayBuilder.
+ * @value: A float value.
+ * @error: (nullable): Return location for a #GError or %NULL.
+ *
+ * Returns: %TRUE on success, %FALSE if there was an error.
+ */
+gboolean
+garrow_float_array_builder_append(GArrowFloatArrayBuilder *builder,
+                                  gfloat value,
+                                  GError **error)
+{
+  auto arrow_builder =
+    static_cast<arrow::FloatBuilder *>(
+      garrow_array_builder_get_raw(GARROW_ARRAY_BUILDER(builder)).get());
+
+  auto status = arrow_builder->Append(value);
+  if (status.ok()) {
+    return TRUE;
+  } else {
+    garrow_error_set(error, status, "[float-array-builder][append]");
+    return FALSE;
+  }
+}
+
+/**
+ * garrow_float_array_builder_append_null:
+ * @builder: A #GArrowFloatArrayBuilder.
+ * @error: (nullable): Return location for a #GError or %NULL.
+ *
+ * Returns: %TRUE on success, %FALSE if there was an error.
+ */
+gboolean
+garrow_float_array_builder_append_null(GArrowFloatArrayBuilder *builder,
+                                       GError **error)
+{
+  auto arrow_builder =
+    static_cast<arrow::FloatBuilder *>(
+      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, "[float-array-builder][append-null]");
+    return FALSE;
+  }
+}
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/float-array-builder.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/float-array-builder.h b/c_glib/arrow-glib/float-array-builder.h
new file mode 100644
index 0000000..0039003
--- /dev/null
+++ b/c_glib/arrow-glib/float-array-builder.h
@@ -0,0 +1,76 @@
+/*
+ * 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_FLOAT_ARRAY_BUILDER         \
+  (garrow_float_array_builder_get_type())
+#define GARROW_FLOAT_ARRAY_BUILDER(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_FLOAT_ARRAY_BUILDER,  \
+                              GArrowFloatArrayBuilder))
+#define GARROW_FLOAT_ARRAY_BUILDER_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_FLOAT_ARRAY_BUILDER,     \
+                           GArrowFloatArrayBuilderClass))
+#define GARROW_IS_FLOAT_ARRAY_BUILDER(obj)                      \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_FLOAT_ARRAY_BUILDER))
+#define GARROW_IS_FLOAT_ARRAY_BUILDER_CLASS(klass)              \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_FLOAT_ARRAY_BUILDER))
+#define GARROW_FLOAT_ARRAY_BUILDER_GET_CLASS(obj)               \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_FLOAT_ARRAY_BUILDER,   \
+                             GArrowFloatArrayBuilderClass))
+
+typedef struct _GArrowFloatArrayBuilder         GArrowFloatArrayBuilder;
+typedef struct _GArrowFloatArrayBuilderClass    GArrowFloatArrayBuilderClass;
+
+/**
+ * GArrowFloatArrayBuilder:
+ *
+ * It wraps `arrow::FloatBuilder`.
+ */
+struct _GArrowFloatArrayBuilder
+{
+  /*< private >*/
+  GArrowArrayBuilder parent_instance;
+};
+
+struct _GArrowFloatArrayBuilderClass
+{
+  GArrowArrayBuilderClass parent_class;
+};
+
+GType garrow_float_array_builder_get_type(void) G_GNUC_CONST;
+
+GArrowFloatArrayBuilder *garrow_float_array_builder_new(void);
+
+gboolean garrow_float_array_builder_append(GArrowFloatArrayBuilder *builder,
+                                           gfloat value,
+                                           GError **error);
+gboolean garrow_float_array_builder_append_null(GArrowFloatArrayBuilder *builder,
+                                                GError **error);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/float-array.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/float-array.cpp b/c_glib/arrow-glib/float-array.cpp
new file mode 100644
index 0000000..28e8047
--- /dev/null
+++ b/c_glib/arrow-glib/float-array.cpp
@@ -0,0 +1,69 @@
+/*
+ * 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/float-array.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: float-array
+ * @short_description: 32-bit floating point array class
+ *
+ * #GArrowFloatArray is a class for 32-bit floating point array. It
+ * can store zero or more 32-bit floating data.
+ *
+ * #GArrowFloatArray is immutable. You need to use
+ * #GArrowFloatArrayBuilder to create a new array.
+ */
+
+G_DEFINE_TYPE(GArrowFloatArray,               \
+              garrow_float_array,             \
+              GARROW_TYPE_ARRAY)
+
+static void
+garrow_float_array_init(GArrowFloatArray *object)
+{
+}
+
+static void
+garrow_float_array_class_init(GArrowFloatArrayClass *klass)
+{
+}
+
+/**
+ * garrow_float_array_get_value:
+ * @array: A #GArrowFloatArray.
+ * @i: The index of the target value.
+ *
+ * Returns: The i-th value.
+ */
+gfloat
+garrow_float_array_get_value(GArrowFloatArray *array,
+                             gint64 i)
+{
+  auto arrow_array = garrow_array_get_raw(GARROW_ARRAY(array));
+  return static_cast<arrow::FloatArray *>(arrow_array.get())->Value(i);
+}
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/float-array.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/float-array.h b/c_glib/arrow-glib/float-array.h
new file mode 100644
index 0000000..d113f97
--- /dev/null
+++ b/c_glib/arrow-glib/float-array.h
@@ -0,0 +1,71 @@
+/*
+ * 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_FLOAT_ARRAY                 \
+  (garrow_float_array_get_type())
+#define GARROW_FLOAT_ARRAY(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                    \
+                              GARROW_TYPE_FLOAT_ARRAY,  \
+                              GArrowFloatArray))
+#define GARROW_FLOAT_ARRAY_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                     \
+                           GARROW_TYPE_FLOAT_ARRAY,     \
+                           GArrowFloatArrayClass))
+#define GARROW_IS_FLOAT_ARRAY(obj)                      \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                    \
+                              GARROW_TYPE_FLOAT_ARRAY))
+#define GARROW_IS_FLOAT_ARRAY_CLASS(klass)              \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                     \
+                           GARROW_TYPE_FLOAT_ARRAY))
+#define GARROW_FLOAT_ARRAY_GET_CLASS(obj)               \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                     \
+                             GARROW_TYPE_FLOAT_ARRAY,   \
+                             GArrowFloatArrayClass))
+
+typedef struct _GArrowFloatArray         GArrowFloatArray;
+typedef struct _GArrowFloatArrayClass    GArrowFloatArrayClass;
+
+/**
+ * GArrowFloatArray:
+ *
+ * It wraps `arrow::FloatArray`.
+ */
+struct _GArrowFloatArray
+{
+  /*< private >*/
+  GArrowArray parent_instance;
+};
+
+struct _GArrowFloatArrayClass
+{
+  GArrowArrayClass parent_class;
+};
+
+GType garrow_float_array_get_type(void) G_GNUC_CONST;
+
+gfloat garrow_float_array_get_value(GArrowFloatArray *array,
+                                    gint64 i);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/float-data-type.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/float-data-type.cpp b/c_glib/arrow-glib/float-data-type.cpp
new file mode 100644
index 0000000..ce7f28a
--- /dev/null
+++ b/c_glib/arrow-glib/float-data-type.cpp
@@ -0,0 +1,68 @@
+/*
+ * 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/float-data-type.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: float-data-type
+ * @short_description: 32-bit floating point data type
+ *
+ * #GArrowFloatDataType is a class for 32-bit floating point 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_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/float-data-type.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/float-data-type.h b/c_glib/arrow-glib/float-data-type.h
new file mode 100644
index 0000000..dcb6c2a
--- /dev/null
+++ b/c_glib/arrow-glib/float-data-type.h
@@ -0,0 +1,69 @@
+/*
+ * 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/data-type.h>
+
+G_BEGIN_DECLS
+
+#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);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int16-array-builder.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int16-array-builder.cpp b/c_glib/arrow-glib/int16-array-builder.cpp
new file mode 100644
index 0000000..fbf18ef
--- /dev/null
+++ b/c_glib/arrow-glib/int16-array-builder.cpp
@@ -0,0 +1,120 @@
+/*
+ * 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/error.hpp>
+#include <arrow-glib/int16-array-builder.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: int16-array-builder
+ * @short_description: 16-bit integer array builder class
+ *
+ * #GArrowInt16ArrayBuilder is the class to create a new
+ * #GArrowInt16Array.
+ */
+
+G_DEFINE_TYPE(GArrowInt16ArrayBuilder,
+              garrow_int16_array_builder,
+              GARROW_TYPE_ARRAY_BUILDER)
+
+static void
+garrow_int16_array_builder_init(GArrowInt16ArrayBuilder *builder)
+{
+}
+
+static void
+garrow_int16_array_builder_class_init(GArrowInt16ArrayBuilderClass *klass)
+{
+}
+
+/**
+ * garrow_int16_array_builder_new:
+ *
+ * Returns: A newly created #GArrowInt16ArrayBuilder.
+ */
+GArrowInt16ArrayBuilder *
+garrow_int16_array_builder_new(void)
+{
+  auto memory_pool = arrow::default_memory_pool();
+  auto arrow_builder =
+    std::make_shared<arrow::Int16Builder>(memory_pool, arrow::int16());
+  auto builder =
+    GARROW_INT16_ARRAY_BUILDER(g_object_new(GARROW_TYPE_INT16_ARRAY_BUILDER,
+                                           "array-builder", &arrow_builder,
+                                           NULL));
+  return builder;
+}
+
+/**
+ * garrow_int16_array_builder_append:
+ * @builder: A #GArrowInt16ArrayBuilder.
+ * @value: A int16 value.
+ * @error: (nullable): Return location for a #GError or %NULL.
+ *
+ * Returns: %TRUE on success, %FALSE if there was an error.
+ */
+gboolean
+garrow_int16_array_builder_append(GArrowInt16ArrayBuilder *builder,
+                                 gint16 value,
+                                 GError **error)
+{
+  auto arrow_builder =
+    static_cast<arrow::Int16Builder *>(
+      garrow_array_builder_get_raw(GARROW_ARRAY_BUILDER(builder)).get());
+
+  auto status = arrow_builder->Append(value);
+  if (status.ok()) {
+    return TRUE;
+  } else {
+    garrow_error_set(error, status, "[int16-array-builder][append]");
+    return FALSE;
+  }
+}
+
+/**
+ * garrow_int16_array_builder_append_null:
+ * @builder: A #GArrowInt16ArrayBuilder.
+ * @error: (nullable): Return location for a #GError or %NULL.
+ *
+ * Returns: %TRUE on success, %FALSE if there was an error.
+ */
+gboolean
+garrow_int16_array_builder_append_null(GArrowInt16ArrayBuilder *builder,
+                                      GError **error)
+{
+  auto arrow_builder =
+    static_cast<arrow::Int16Builder *>(
+      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, "[int16-array-builder][append-null]");
+    return FALSE;
+  }
+}
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int16-array-builder.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int16-array-builder.h b/c_glib/arrow-glib/int16-array-builder.h
new file mode 100644
index 0000000..f222cfd
--- /dev/null
+++ b/c_glib/arrow-glib/int16-array-builder.h
@@ -0,0 +1,76 @@
+/*
+ * 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_INT16_ARRAY_BUILDER          \
+  (garrow_int16_array_builder_get_type())
+#define GARROW_INT16_ARRAY_BUILDER(obj)                          \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_INT16_ARRAY_BUILDER,   \
+                              GArrowInt16ArrayBuilder))
+#define GARROW_INT16_ARRAY_BUILDER_CLASS(klass)                  \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_INT16_ARRAY_BUILDER,      \
+                           GArrowInt16ArrayBuilderClass))
+#define GARROW_IS_INT16_ARRAY_BUILDER(obj)                       \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_INT16_ARRAY_BUILDER))
+#define GARROW_IS_INT16_ARRAY_BUILDER_CLASS(klass)               \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_INT16_ARRAY_BUILDER))
+#define GARROW_INT16_ARRAY_BUILDER_GET_CLASS(obj)                \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_INT16_ARRAY_BUILDER,    \
+                             GArrowInt16ArrayBuilderClass))
+
+typedef struct _GArrowInt16ArrayBuilder         GArrowInt16ArrayBuilder;
+typedef struct _GArrowInt16ArrayBuilderClass    GArrowInt16ArrayBuilderClass;
+
+/**
+ * GArrowInt16ArrayBuilder:
+ *
+ * It wraps `arrow::Int16Builder`.
+ */
+struct _GArrowInt16ArrayBuilder
+{
+  /*< private >*/
+  GArrowArrayBuilder parent_instance;
+};
+
+struct _GArrowInt16ArrayBuilderClass
+{
+  GArrowArrayBuilderClass parent_class;
+};
+
+GType garrow_int16_array_builder_get_type(void) G_GNUC_CONST;
+
+GArrowInt16ArrayBuilder *garrow_int16_array_builder_new(void);
+
+gboolean garrow_int16_array_builder_append(GArrowInt16ArrayBuilder *builder,
+                                          gint16 value,
+                                          GError **error);
+gboolean garrow_int16_array_builder_append_null(GArrowInt16ArrayBuilder *builder,
+                                               GError **error);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int16-array.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int16-array.cpp b/c_glib/arrow-glib/int16-array.cpp
new file mode 100644
index 0000000..456d085
--- /dev/null
+++ b/c_glib/arrow-glib/int16-array.cpp
@@ -0,0 +1,69 @@
+/*
+ * 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/int16-array.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: int16-array
+ * @short_description: 16-bit integer array class
+ *
+ * #GArrowInt16Array is a class for 16-bit integer array. It can store
+ * zero or more 16-bit integer data.
+ *
+ * #GArrowInt16Array is immutable. You need to use
+ * #GArrowInt16ArrayBuilder to create a new array.
+ */
+
+G_DEFINE_TYPE(GArrowInt16Array,               \
+              garrow_int16_array,             \
+              GARROW_TYPE_ARRAY)
+
+static void
+garrow_int16_array_init(GArrowInt16Array *object)
+{
+}
+
+static void
+garrow_int16_array_class_init(GArrowInt16ArrayClass *klass)
+{
+}
+
+/**
+ * garrow_int16_array_get_value:
+ * @array: A #GArrowInt16Array.
+ * @i: The index of the target value.
+ *
+ * Returns: The i-th value.
+ */
+gint16
+garrow_int16_array_get_value(GArrowInt16Array *array,
+                             gint64 i)
+{
+  auto arrow_array = garrow_array_get_raw(GARROW_ARRAY(array));
+  return static_cast<arrow::Int16Array *>(arrow_array.get())->Value(i);
+}
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int16-array.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int16-array.h b/c_glib/arrow-glib/int16-array.h
new file mode 100644
index 0000000..d37144c
--- /dev/null
+++ b/c_glib/arrow-glib/int16-array.h
@@ -0,0 +1,71 @@
+/*
+ * 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_INT16_ARRAY                  \
+  (garrow_int16_array_get_type())
+#define GARROW_INT16_ARRAY(obj)                          \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                    \
+                              GARROW_TYPE_INT16_ARRAY,   \
+                              GArrowInt16Array))
+#define GARROW_INT16_ARRAY_CLASS(klass)                  \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                     \
+                           GARROW_TYPE_INT16_ARRAY,      \
+                           GArrowInt16ArrayClass))
+#define GARROW_IS_INT16_ARRAY(obj)                       \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                    \
+                              GARROW_TYPE_INT16_ARRAY))
+#define GARROW_IS_INT16_ARRAY_CLASS(klass)               \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                     \
+                           GARROW_TYPE_INT16_ARRAY))
+#define GARROW_INT16_ARRAY_GET_CLASS(obj)                \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                     \
+                             GARROW_TYPE_INT16_ARRAY,    \
+                             GArrowInt16ArrayClass))
+
+typedef struct _GArrowInt16Array         GArrowInt16Array;
+typedef struct _GArrowInt16ArrayClass    GArrowInt16ArrayClass;
+
+/**
+ * GArrowInt16Array:
+ *
+ * It wraps `arrow::Int16Array`.
+ */
+struct _GArrowInt16Array
+{
+  /*< private >*/
+  GArrowArray parent_instance;
+};
+
+struct _GArrowInt16ArrayClass
+{
+  GArrowArrayClass parent_class;
+};
+
+GType garrow_int16_array_get_type(void) G_GNUC_CONST;
+
+gint16 garrow_int16_array_get_value(GArrowInt16Array *array,
+                                  gint64 i);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int16-data-type.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int16-data-type.cpp b/c_glib/arrow-glib/int16-data-type.cpp
new file mode 100644
index 0000000..45e109e
--- /dev/null
+++ b/c_glib/arrow-glib/int16-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/int16-data-type.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: int16-data-type
+ * @short_description: 16-bit integer data type
+ *
+ * #GArrowInt16DataType is a class for 16-bit integer 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_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int16-data-type.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int16-data-type.h b/c_glib/arrow-glib/int16-data-type.h
new file mode 100644
index 0000000..eaa199c
--- /dev/null
+++ b/c_glib/arrow-glib/int16-data-type.h
@@ -0,0 +1,69 @@
+/*
+ * 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/data-type.h>
+
+G_BEGIN_DECLS
+
+#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);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int32-array-builder.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int32-array-builder.cpp b/c_glib/arrow-glib/int32-array-builder.cpp
new file mode 100644
index 0000000..30cc470
--- /dev/null
+++ b/c_glib/arrow-glib/int32-array-builder.cpp
@@ -0,0 +1,120 @@
+/*
+ * 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/error.hpp>
+#include <arrow-glib/int32-array-builder.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: int32-array-builder
+ * @short_description: 32-bit integer array builder class
+ *
+ * #GArrowInt32ArrayBuilder is the class to create a new
+ * #GArrowInt32Array.
+ */
+
+G_DEFINE_TYPE(GArrowInt32ArrayBuilder,
+              garrow_int32_array_builder,
+              GARROW_TYPE_ARRAY_BUILDER)
+
+static void
+garrow_int32_array_builder_init(GArrowInt32ArrayBuilder *builder)
+{
+}
+
+static void
+garrow_int32_array_builder_class_init(GArrowInt32ArrayBuilderClass *klass)
+{
+}
+
+/**
+ * garrow_int32_array_builder_new:
+ *
+ * Returns: A newly created #GArrowInt32ArrayBuilder.
+ */
+GArrowInt32ArrayBuilder *
+garrow_int32_array_builder_new(void)
+{
+  auto memory_pool = arrow::default_memory_pool();
+  auto arrow_builder =
+    std::make_shared<arrow::Int32Builder>(memory_pool, arrow::int32());
+  auto builder =
+    GARROW_INT32_ARRAY_BUILDER(g_object_new(GARROW_TYPE_INT32_ARRAY_BUILDER,
+                                           "array-builder", &arrow_builder,
+                                           NULL));
+  return builder;
+}
+
+/**
+ * garrow_int32_array_builder_append:
+ * @builder: A #GArrowInt32ArrayBuilder.
+ * @value: A int32 value.
+ * @error: (nullable): Return location for a #GError or %NULL.
+ *
+ * Returns: %TRUE on success, %FALSE if there was an error.
+ */
+gboolean
+garrow_int32_array_builder_append(GArrowInt32ArrayBuilder *builder,
+                                 gint32 value,
+                                 GError **error)
+{
+  auto arrow_builder =
+    static_cast<arrow::Int32Builder *>(
+      garrow_array_builder_get_raw(GARROW_ARRAY_BUILDER(builder)).get());
+
+  auto status = arrow_builder->Append(value);
+  if (status.ok()) {
+    return TRUE;
+  } else {
+    garrow_error_set(error, status, "[int32-array-builder][append]");
+    return FALSE;
+  }
+}
+
+/**
+ * garrow_int32_array_builder_append_null:
+ * @builder: A #GArrowInt32ArrayBuilder.
+ * @error: (nullable): Return location for a #GError or %NULL.
+ *
+ * Returns: %TRUE on success, %FALSE if there was an error.
+ */
+gboolean
+garrow_int32_array_builder_append_null(GArrowInt32ArrayBuilder *builder,
+                                      GError **error)
+{
+  auto arrow_builder =
+    static_cast<arrow::Int32Builder *>(
+      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, "[int32-array-builder][append-null]");
+    return FALSE;
+  }
+}
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int32-array-builder.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int32-array-builder.h b/c_glib/arrow-glib/int32-array-builder.h
new file mode 100644
index 0000000..bdb380d
--- /dev/null
+++ b/c_glib/arrow-glib/int32-array-builder.h
@@ -0,0 +1,76 @@
+/*
+ * 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_INT32_ARRAY_BUILDER         \
+  (garrow_int32_array_builder_get_type())
+#define GARROW_INT32_ARRAY_BUILDER(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_INT32_ARRAY_BUILDER,  \
+                              GArrowInt32ArrayBuilder))
+#define GARROW_INT32_ARRAY_BUILDER_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_INT32_ARRAY_BUILDER,     \
+                           GArrowInt32ArrayBuilderClass))
+#define GARROW_IS_INT32_ARRAY_BUILDER(obj)                      \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_INT32_ARRAY_BUILDER))
+#define GARROW_IS_INT32_ARRAY_BUILDER_CLASS(klass)              \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_INT32_ARRAY_BUILDER))
+#define GARROW_INT32_ARRAY_BUILDER_GET_CLASS(obj)               \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_INT32_ARRAY_BUILDER,   \
+                             GArrowInt32ArrayBuilderClass))
+
+typedef struct _GArrowInt32ArrayBuilder         GArrowInt32ArrayBuilder;
+typedef struct _GArrowInt32ArrayBuilderClass    GArrowInt32ArrayBuilderClass;
+
+/**
+ * GArrowInt32ArrayBuilder:
+ *
+ * It wraps `arrow::Int32Builder`.
+ */
+struct _GArrowInt32ArrayBuilder
+{
+  /*< private >*/
+  GArrowArrayBuilder parent_instance;
+};
+
+struct _GArrowInt32ArrayBuilderClass
+{
+  GArrowArrayBuilderClass parent_class;
+};
+
+GType garrow_int32_array_builder_get_type(void) G_GNUC_CONST;
+
+GArrowInt32ArrayBuilder *garrow_int32_array_builder_new(void);
+
+gboolean garrow_int32_array_builder_append(GArrowInt32ArrayBuilder *builder,
+                                           gint32 value,
+                                           GError **error);
+gboolean garrow_int32_array_builder_append_null(GArrowInt32ArrayBuilder *builder,
+                                                GError **error);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int32-array.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int32-array.cpp b/c_glib/arrow-glib/int32-array.cpp
new file mode 100644
index 0000000..8bd6f35
--- /dev/null
+++ b/c_glib/arrow-glib/int32-array.cpp
@@ -0,0 +1,69 @@
+/*
+ * 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/int32-array.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: int32-array
+ * @short_description: 32-bit integer array class
+ *
+ * #GArrowInt32Array is a class for 32-bit integer array. It can store
+ * zero or more 32-bit integer data.
+ *
+ * #GArrowInt32Array is immutable. You need to use
+ * #GArrowInt32ArrayBuilder to create a new array.
+ */
+
+G_DEFINE_TYPE(GArrowInt32Array,               \
+              garrow_int32_array,             \
+              GARROW_TYPE_ARRAY)
+
+static void
+garrow_int32_array_init(GArrowInt32Array *object)
+{
+}
+
+static void
+garrow_int32_array_class_init(GArrowInt32ArrayClass *klass)
+{
+}
+
+/**
+ * garrow_int32_array_get_value:
+ * @array: A #GArrowInt32Array.
+ * @i: The index of the target value.
+ *
+ * Returns: The i-th value.
+ */
+gint32
+garrow_int32_array_get_value(GArrowInt32Array *array,
+                             gint64 i)
+{
+  auto arrow_array = garrow_array_get_raw(GARROW_ARRAY(array));
+  return static_cast<arrow::Int32Array *>(arrow_array.get())->Value(i);
+}
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int32-array.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int32-array.h b/c_glib/arrow-glib/int32-array.h
new file mode 100644
index 0000000..cce2b41
--- /dev/null
+++ b/c_glib/arrow-glib/int32-array.h
@@ -0,0 +1,71 @@
+/*
+ * 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_INT32_ARRAY                  \
+  (garrow_int32_array_get_type())
+#define GARROW_INT32_ARRAY(obj)                          \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                    \
+                              GARROW_TYPE_INT32_ARRAY,   \
+                              GArrowInt32Array))
+#define GARROW_INT32_ARRAY_CLASS(klass)                  \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                     \
+                           GARROW_TYPE_INT32_ARRAY,      \
+                           GArrowInt32ArrayClass))
+#define GARROW_IS_INT32_ARRAY(obj)                       \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                    \
+                              GARROW_TYPE_INT32_ARRAY))
+#define GARROW_IS_INT32_ARRAY_CLASS(klass)               \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                     \
+                           GARROW_TYPE_INT32_ARRAY))
+#define GARROW_INT32_ARRAY_GET_CLASS(obj)                \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                     \
+                             GARROW_TYPE_INT32_ARRAY,    \
+                             GArrowInt32ArrayClass))
+
+typedef struct _GArrowInt32Array         GArrowInt32Array;
+typedef struct _GArrowInt32ArrayClass    GArrowInt32ArrayClass;
+
+/**
+ * GArrowInt32Array:
+ *
+ * It wraps `arrow::Int32Array`.
+ */
+struct _GArrowInt32Array
+{
+  /*< private >*/
+  GArrowArray parent_instance;
+};
+
+struct _GArrowInt32ArrayClass
+{
+  GArrowArrayClass parent_class;
+};
+
+GType garrow_int32_array_get_type(void) G_GNUC_CONST;
+
+gint32 garrow_int32_array_get_value(GArrowInt32Array *array,
+                                  gint64 i);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int32-data-type.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int32-data-type.cpp b/c_glib/arrow-glib/int32-data-type.cpp
new file mode 100644
index 0000000..add2113
--- /dev/null
+++ b/c_glib/arrow-glib/int32-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/int32-data-type.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: int32-data-type
+ * @short_description: 32-bit integer data type
+ *
+ * #GArrowInt32DataType is a class for 32-bit integer 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_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int32-data-type.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int32-data-type.h b/c_glib/arrow-glib/int32-data-type.h
new file mode 100644
index 0000000..75cccbd
--- /dev/null
+++ b/c_glib/arrow-glib/int32-data-type.h
@@ -0,0 +1,69 @@
+/*
+ * 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/data-type.h>
+
+G_BEGIN_DECLS
+
+#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);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int64-array-builder.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int64-array-builder.cpp b/c_glib/arrow-glib/int64-array-builder.cpp
new file mode 100644
index 0000000..b5eff11
--- /dev/null
+++ b/c_glib/arrow-glib/int64-array-builder.cpp
@@ -0,0 +1,120 @@
+/*
+ * 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/error.hpp>
+#include <arrow-glib/int64-array-builder.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: int64-array-builder
+ * @short_description: 64-bit integer array builder class
+ *
+ * #GArrowInt64ArrayBuilder is the class to create a new
+ * #GArrowInt64Array.
+ */
+
+G_DEFINE_TYPE(GArrowInt64ArrayBuilder,
+              garrow_int64_array_builder,
+              GARROW_TYPE_ARRAY_BUILDER)
+
+static void
+garrow_int64_array_builder_init(GArrowInt64ArrayBuilder *builder)
+{
+}
+
+static void
+garrow_int64_array_builder_class_init(GArrowInt64ArrayBuilderClass *klass)
+{
+}
+
+/**
+ * garrow_int64_array_builder_new:
+ *
+ * Returns: A newly created #GArrowInt64ArrayBuilder.
+ */
+GArrowInt64ArrayBuilder *
+garrow_int64_array_builder_new(void)
+{
+  auto memory_pool = arrow::default_memory_pool();
+  auto arrow_builder =
+    std::make_shared<arrow::Int64Builder>(memory_pool, arrow::int64());
+  auto builder =
+    GARROW_INT64_ARRAY_BUILDER(g_object_new(GARROW_TYPE_INT64_ARRAY_BUILDER,
+                                           "array-builder", &arrow_builder,
+                                           NULL));
+  return builder;
+}
+
+/**
+ * garrow_int64_array_builder_append:
+ * @builder: A #GArrowInt64ArrayBuilder.
+ * @value: A int64 value.
+ * @error: (nullable): Return location for a #GError or %NULL.
+ *
+ * Returns: %TRUE on success, %FALSE if there was an error.
+ */
+gboolean
+garrow_int64_array_builder_append(GArrowInt64ArrayBuilder *builder,
+                                  gint64 value,
+                                  GError **error)
+{
+  auto arrow_builder =
+    static_cast<arrow::Int64Builder *>(
+      garrow_array_builder_get_raw(GARROW_ARRAY_BUILDER(builder)).get());
+
+  auto status = arrow_builder->Append(value);
+  if (status.ok()) {
+    return TRUE;
+  } else {
+    garrow_error_set(error, status, "[int64-array-builder][append]");
+    return FALSE;
+  }
+}
+
+/**
+ * garrow_int64_array_builder_append_null:
+ * @builder: A #GArrowInt64ArrayBuilder.
+ * @error: (nullable): Return location for a #GError or %NULL.
+ *
+ * Returns: %TRUE on success, %FALSE if there was an error.
+ */
+gboolean
+garrow_int64_array_builder_append_null(GArrowInt64ArrayBuilder *builder,
+                                      GError **error)
+{
+  auto arrow_builder =
+    static_cast<arrow::Int64Builder *>(
+      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, "[int64-array-builder][append-null]");
+    return FALSE;
+  }
+}
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int64-array-builder.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int64-array-builder.h b/c_glib/arrow-glib/int64-array-builder.h
new file mode 100644
index 0000000..8f4947e
--- /dev/null
+++ b/c_glib/arrow-glib/int64-array-builder.h
@@ -0,0 +1,76 @@
+/*
+ * 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_INT64_ARRAY_BUILDER          \
+  (garrow_int64_array_builder_get_type())
+#define GARROW_INT64_ARRAY_BUILDER(obj)                          \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                            \
+                              GARROW_TYPE_INT64_ARRAY_BUILDER,   \
+                              GArrowInt64ArrayBuilder))
+#define GARROW_INT64_ARRAY_BUILDER_CLASS(klass)                  \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                             \
+                           GARROW_TYPE_INT64_ARRAY_BUILDER,      \
+                           GArrowInt64ArrayBuilderClass))
+#define GARROW_IS_INT64_ARRAY_BUILDER(obj)                       \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                            \
+                              GARROW_TYPE_INT64_ARRAY_BUILDER))
+#define GARROW_IS_INT64_ARRAY_BUILDER_CLASS(klass)               \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
+                           GARROW_TYPE_INT64_ARRAY_BUILDER))
+#define GARROW_INT64_ARRAY_BUILDER_GET_CLASS(obj)                \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                             \
+                             GARROW_TYPE_INT64_ARRAY_BUILDER,    \
+                             GArrowInt64ArrayBuilderClass))
+
+typedef struct _GArrowInt64ArrayBuilder         GArrowInt64ArrayBuilder;
+typedef struct _GArrowInt64ArrayBuilderClass    GArrowInt64ArrayBuilderClass;
+
+/**
+ * GArrowInt64ArrayBuilder:
+ *
+ * It wraps `arrow::Int64Builder`.
+ */
+struct _GArrowInt64ArrayBuilder
+{
+  /*< private >*/
+  GArrowArrayBuilder parent_instance;
+};
+
+struct _GArrowInt64ArrayBuilderClass
+{
+  GArrowArrayBuilderClass parent_class;
+};
+
+GType garrow_int64_array_builder_get_type(void) G_GNUC_CONST;
+
+GArrowInt64ArrayBuilder *garrow_int64_array_builder_new(void);
+
+gboolean garrow_int64_array_builder_append(GArrowInt64ArrayBuilder *builder,
+                                          gint64 value,
+                                          GError **error);
+gboolean garrow_int64_array_builder_append_null(GArrowInt64ArrayBuilder *builder,
+                                               GError **error);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int64-array.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int64-array.cpp b/c_glib/arrow-glib/int64-array.cpp
new file mode 100644
index 0000000..be49d5b
--- /dev/null
+++ b/c_glib/arrow-glib/int64-array.cpp
@@ -0,0 +1,69 @@
+/*
+ * 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/int64-array.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: int64-array
+ * @short_description: 64-bit integer array class
+ *
+ * #GArrowInt64Array is a class for 64-bit integer array. It can store
+ * zero or more 64-bit integer data.
+ *
+ * #GArrowInt64Array is immutable. You need to use
+ * #GArrowInt64ArrayBuilder to create a new array.
+ */
+
+G_DEFINE_TYPE(GArrowInt64Array,               \
+              garrow_int64_array,             \
+              GARROW_TYPE_ARRAY)
+
+static void
+garrow_int64_array_init(GArrowInt64Array *object)
+{
+}
+
+static void
+garrow_int64_array_class_init(GArrowInt64ArrayClass *klass)
+{
+}
+
+/**
+ * garrow_int64_array_get_value:
+ * @array: A #GArrowInt64Array.
+ * @i: The index of the target value.
+ *
+ * Returns: The i-th value.
+ */
+gint64
+garrow_int64_array_get_value(GArrowInt64Array *array,
+                             gint64 i)
+{
+  auto arrow_array = garrow_array_get_raw(GARROW_ARRAY(array));
+  return static_cast<arrow::Int64Array *>(arrow_array.get())->Value(i);
+}
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int64-array.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int64-array.h b/c_glib/arrow-glib/int64-array.h
new file mode 100644
index 0000000..73d4c64
--- /dev/null
+++ b/c_glib/arrow-glib/int64-array.h
@@ -0,0 +1,71 @@
+/*
+ * 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_INT64_ARRAY                  \
+  (garrow_int64_array_get_type())
+#define GARROW_INT64_ARRAY(obj)                          \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),                    \
+                              GARROW_TYPE_INT64_ARRAY,   \
+                              GArrowInt64Array))
+#define GARROW_INT64_ARRAY_CLASS(klass)                  \
+  (G_TYPE_CHECK_CLASS_CAST((klass),                     \
+                           GARROW_TYPE_INT64_ARRAY,      \
+                           GArrowInt64ArrayClass))
+#define GARROW_IS_INT64_ARRAY(obj)                       \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),                    \
+                              GARROW_TYPE_INT64_ARRAY))
+#define GARROW_IS_INT64_ARRAY_CLASS(klass)               \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),                     \
+                           GARROW_TYPE_INT64_ARRAY))
+#define GARROW_INT64_ARRAY_GET_CLASS(obj)                \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),                     \
+                             GARROW_TYPE_INT64_ARRAY,    \
+                             GArrowInt64ArrayClass))
+
+typedef struct _GArrowInt64Array         GArrowInt64Array;
+typedef struct _GArrowInt64ArrayClass    GArrowInt64ArrayClass;
+
+/**
+ * GArrowInt64Array:
+ *
+ * It wraps `arrow::Int64Array`.
+ */
+struct _GArrowInt64Array
+{
+  /*< private >*/
+  GArrowArray parent_instance;
+};
+
+struct _GArrowInt64ArrayClass
+{
+  GArrowArrayClass parent_class;
+};
+
+GType garrow_int64_array_get_type(void) G_GNUC_CONST;
+
+gint64 garrow_int64_array_get_value(GArrowInt64Array *array,
+                                    gint64 i);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int64-data-type.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int64-data-type.cpp b/c_glib/arrow-glib/int64-data-type.cpp
new file mode 100644
index 0000000..8e85b9d
--- /dev/null
+++ b/c_glib/arrow-glib/int64-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/int64-data-type.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: int64-data-type
+ * @short_description: 64-bit integer data type
+ *
+ * #GArrowInt64DataType is a class for 64-bit integer 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_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int64-data-type.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int64-data-type.h b/c_glib/arrow-glib/int64-data-type.h
new file mode 100644
index 0000000..499e79f
--- /dev/null
+++ b/c_glib/arrow-glib/int64-data-type.h
@@ -0,0 +1,69 @@
+/*
+ * 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/data-type.h>
+
+G_BEGIN_DECLS
+
+#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);
+
+G_END_DECLS

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/arrow-glib/int8-array-builder.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/int8-array-builder.cpp b/c_glib/arrow-glib/int8-array-builder.cpp
new file mode 100644
index 0000000..5107a6f
--- /dev/null
+++ b/c_glib/arrow-glib/int8-array-builder.cpp
@@ -0,0 +1,120 @@
+/*
+ * 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/error.hpp>
+#include <arrow-glib/int8-array-builder.h>
+
+G_BEGIN_DECLS
+
+/**
+ * SECTION: int8-array-builder
+ * @short_description: 8-bit integer array builder class
+ *
+ * #GArrowInt8ArrayBuilder is the class to create a new
+ * #GArrowInt8Array.
+ */
+
+G_DEFINE_TYPE(GArrowInt8ArrayBuilder,
+              garrow_int8_array_builder,
+              GARROW_TYPE_ARRAY_BUILDER)
+
+static void
+garrow_int8_array_builder_init(GArrowInt8ArrayBuilder *builder)
+{
+}
+
+static void
+garrow_int8_array_builder_class_init(GArrowInt8ArrayBuilderClass *klass)
+{
+}
+
+/**
+ * garrow_int8_array_builder_new:
+ *
+ * Returns: A newly created #GArrowInt8ArrayBuilder.
+ */
+GArrowInt8ArrayBuilder *
+garrow_int8_array_builder_new(void)
+{
+  auto memory_pool = arrow::default_memory_pool();
+  auto arrow_builder =
+    std::make_shared<arrow::Int8Builder>(memory_pool, arrow::int8());
+  auto builder =
+    GARROW_INT8_ARRAY_BUILDER(g_object_new(GARROW_TYPE_INT8_ARRAY_BUILDER,
+                                           "array-builder", &arrow_builder,
+                                           NULL));
+  return builder;
+}
+
+/**
+ * garrow_int8_array_builder_append:
+ * @builder: A #GArrowInt8ArrayBuilder.
+ * @value: A int8 value.
+ * @error: (nullable): Return location for a #GError or %NULL.
+ *
+ * Returns: %TRUE on success, %FALSE if there was an error.
+ */
+gboolean
+garrow_int8_array_builder_append(GArrowInt8ArrayBuilder *builder,
+                                 gint8 value,
+                                 GError **error)
+{
+  auto arrow_builder =
+    static_cast<arrow::Int8Builder *>(
+      garrow_array_builder_get_raw(GARROW_ARRAY_BUILDER(builder)).get());
+
+  auto status = arrow_builder->Append(value);
+  if (status.ok()) {
+    return TRUE;
+  } else {
+    garrow_error_set(error, status, "[int8-array-builder][append]");
+    return FALSE;
+  }
+}
+
+/**
+ * garrow_int8_array_builder_append_null:
+ * @builder: A #GArrowInt8ArrayBuilder.
+ * @error: (nullable): Return location for a #GError or %NULL.
+ *
+ * Returns: %TRUE on success, %FALSE if there was an error.
+ */
+gboolean
+garrow_int8_array_builder_append_null(GArrowInt8ArrayBuilder *builder,
+                                      GError **error)
+{
+  auto arrow_builder =
+    static_cast<arrow::Int8Builder *>(
+      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, "[int8-array-builder][append-null]");
+    return FALSE;
+  }
+}
+
+G_END_DECLS


Mime
View raw message