kou commented on code in PR #46774:
URL: https://github.com/apache/arrow/pull/46774#discussion_r2151133802


##########
c_glib/arrow-glib/composite-data-type.cpp:
##########
@@ -767,4 +787,93 @@ garrow_run_end_encoded_data_type_get_value_data_type(
   return garrow_data_type_new_raw(&arrow_value_data_type);
 }
 
+enum {
+  PROP_LIST_SIZE = 1
+};
+
+G_DEFINE_TYPE(GArrowFixedSizeListDataType,
+              garrow_fixed_size_list_data_type,
+              GARROW_TYPE_BASE_LIST_DATA_TYPE)
+
+static void
+garrow_fixed_size_list_data_type_get_property(GObject *object,
+                                              guint prop_id,
+                                              GValue *value,
+                                              GParamSpec *pspec)
+{
+  auto arrow_data_type = garrow_data_type_get_raw(GARROW_DATA_TYPE(object));
+  const auto arrow_fixed_size_list_type =
+    std::static_pointer_cast<arrow::FixedSizeListType>(arrow_data_type);
+
+  switch (prop_id) {
+  case PROP_LIST_SIZE:
+    g_value_set_int(value, arrow_fixed_size_list_type->list_size());
+    break;
+  default:
+    G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+    break;
+  }
+}
+
+static void
+garrow_fixed_size_list_data_type_class_init(GArrowFixedSizeListDataTypeClass 
*klass)
+{
+  GObjectClass *gobject_class;
+  GParamSpec *spec;
+
+  gobject_class = G_OBJECT_CLASS(klass);
+  gobject_class->get_property = garrow_fixed_size_list_data_type_get_property;
+
+  spec = g_param_spec_int("list-size",
+                          "List size",
+                          "The list size of the elements",
+                          G_MININT,
+                          G_MAXINT,
+                          0,
+                          G_PARAM_READABLE);
+  g_object_class_install_property(gobject_class, PROP_LIST_SIZE, spec);
+}
+
+static void
+garrow_fixed_size_list_data_type_init(GArrowFixedSizeListDataType *object)
+{
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_data_type:
+ * @value_type: The data type of an element of each list.
+ * @list_size: The size of each list.
+ *
+ * Returns: A newly created fixed size list data type.
+ *
+ * Since: 21.0.0
+ */
+GArrowFixedSizeListDataType *
+garrow_fixed_size_list_data_type_new_data_type(GArrowDataType *value_type,
+                                               gint32 list_size)
+{
+  auto arrow_value_type = garrow_data_type_get_raw(value_type);
+  auto arrow_fixed_size_list_data_type =
+    arrow::fixed_size_list(arrow_value_type, list_size);
+  return GARROW_FIXED_SIZE_LIST_DATA_TYPE(
+    garrow_data_type_new_raw(&arrow_fixed_size_list_data_type));
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_field:
+ * @field: The field of an element of each list.

Review Comment:
   ```suggestion
    * @field: The field of lists.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to