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


##########
c_glib/test/test-fixed-size-list-data-type.rb:
##########
@@ -0,0 +1,51 @@
+# 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.
+
+class TestFixedSizeListDataType < Test::Unit::TestCase
+  sub_test_case(".new") do
+    def setup
+      @list_type = Arrow::BooleanDataType.new
+      @list_size = 5
+      @list_name = "bool_field"
+    end
+
+    def test_new_field

Review Comment:
   `new_` is redundant in `sub_test_case(".new")`.
   
   ```suggestion
       def test_field
   ```



##########
c_glib/arrow-glib/composite-data-type.cpp:
##########
@@ -767,4 +767,64 @@ garrow_run_end_encoded_data_type_get_value_data_type(
   return garrow_data_type_new_raw(&arrow_value_data_type);
 }
 
+G_DEFINE_TYPE(GArrowFixedSizeListDataType,
+              garrow_fixed_size_list_data_type,
+              GARROW_TYPE_BASE_LIST_DATA_TYPE)
+
+static void
+garrow_fixed_size_list_data_type_init(GArrowFixedSizeListDataType *object)
+{
+}
+
+static void
+garrow_fixed_size_list_data_type_class_init(GArrowFixedSizeListDataTypeClass 
*klass)
+{
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_data_type:
+ * @data_type: The data type of elements.
+ * @list_size: The size of value.
+ *
+ * Returns: (transfer full) : The newly created fixed size list data type.
+ *
+ * Since: 21.0.0
+ */
+GArrowFixedSizeListDataType *
+garrow_fixed_size_list_data_type_new_data_type(GArrowDataType *data_type,

Review Comment:
   `value_type` is better than `data_type`.
   
   ```suggestion
   garrow_fixed_size_list_data_type_new_data_type(GArrowDataType *value_type,
   ```



##########
c_glib/test/test-fixed-size-list-data-type.rb:
##########
@@ -0,0 +1,51 @@
+# 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.
+
+class TestFixedSizeListDataType < Test::Unit::TestCase
+  sub_test_case(".new") do
+    def setup
+      @list_type = Arrow::BooleanDataType.new

Review Comment:
   ```suggestion
         @value_type = Arrow::BooleanDataType.new
   ```
   



##########
c_glib/test/test-fixed-size-list-data-type.rb:
##########
@@ -0,0 +1,51 @@
+# 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.
+
+class TestFixedSizeListDataType < Test::Unit::TestCase
+  sub_test_case(".new") do
+    def setup
+      @list_type = Arrow::BooleanDataType.new
+      @list_size = 5
+      @list_name = "bool_field"
+    end
+
+    def test_new_field
+      field = Arrow::Field.new(@list_name, @list_type)
+      data_type = Arrow::FixedSizeListDataType.new(field, @list_size);
+      assert_equal(Arrow::Type::FIXED_SIZE_LIST, data_type.id);
+    end
+
+    def test_new_data_type
+      data_type = Arrow::FixedSizeListDataType.new(@list_type, @list_size);
+      assert_equal(Arrow::Type::FIXED_SIZE_LIST, data_type.id);
+    end
+  end
+
+  sub_test_case(".instance_method") do

Review Comment:
   ```suggestion
     sub_test_case("instance_methods") do
   ```



##########
c_glib/test/test-fixed-size-list-data-type.rb:
##########
@@ -0,0 +1,51 @@
+# 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.
+
+class TestFixedSizeListDataType < Test::Unit::TestCase
+  sub_test_case(".new") do
+    def setup
+      @list_type = Arrow::BooleanDataType.new
+      @list_size = 5
+      @list_name = "bool_field"

Review Comment:
   ```suggestion
         @field_name = "bool_field"
   ```



##########
c_glib/arrow-glib/composite-data-type.cpp:
##########
@@ -767,4 +767,64 @@ garrow_run_end_encoded_data_type_get_value_data_type(
   return garrow_data_type_new_raw(&arrow_value_data_type);
 }
 
+G_DEFINE_TYPE(GArrowFixedSizeListDataType,
+              garrow_fixed_size_list_data_type,
+              GARROW_TYPE_BASE_LIST_DATA_TYPE)
+
+static void
+garrow_fixed_size_list_data_type_init(GArrowFixedSizeListDataType *object)
+{
+}
+
+static void
+garrow_fixed_size_list_data_type_class_init(GArrowFixedSizeListDataTypeClass 
*klass)
+{
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_data_type:
+ * @data_type: The data type of elements.
+ * @list_size: The size of value.
+ *
+ * Returns: (transfer full) : The newly created fixed size list data type.

Review Comment:
   We can omit `(transfer full)` annotation for constructors.
   
   ```suggestion
    * Returns: A newly created fixed size list data type.
   ```



##########
c_glib/arrow-glib/composite-data-type.cpp:
##########
@@ -767,4 +767,64 @@ garrow_run_end_encoded_data_type_get_value_data_type(
   return garrow_data_type_new_raw(&arrow_value_data_type);
 }
 
+G_DEFINE_TYPE(GArrowFixedSizeListDataType,
+              garrow_fixed_size_list_data_type,
+              GARROW_TYPE_BASE_LIST_DATA_TYPE)
+
+static void
+garrow_fixed_size_list_data_type_init(GArrowFixedSizeListDataType *object)
+{
+}
+
+static void
+garrow_fixed_size_list_data_type_class_init(GArrowFixedSizeListDataTypeClass 
*klass)
+{
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_data_type:
+ * @data_type: The data type of elements.
+ * @list_size: The size of value.
+ *
+ * Returns: (transfer full) : The newly created fixed size list data type.
+ *
+ * Since: 21.0.0
+ */
+GArrowFixedSizeListDataType *
+garrow_fixed_size_list_data_type_new_data_type(GArrowDataType *data_type,
+                                               gint32 list_size)
+{
+  auto arrow_data_type = garrow_data_type_get_raw(data_type);
+
+  auto arrow_fixed_size_list_data_type =
+    std::make_shared<arrow::FixedSizeListType>(arrow_data_type, list_size);
+  return GARROW_FIXED_SIZE_LIST_DATA_TYPE(
+    g_object_new(GARROW_TYPE_FIXED_SIZE_LIST_DATA_TYPE,
+                 "data-type",
+                 &arrow_fixed_size_list_data_type,
+                 nullptr));
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_field:
+ * @field: The field of elements.
+ * @list_size: The size of value.
+ *
+ * Returns: (transfer full) : The newly created fixed size list data type.
+ *
+ * Since: 21.0.0
+ */
+GArrowFixedSizeListDataType *
+garrow_fixed_size_list_data_type_new_field(GArrowField *field, gint32 
list_size)
+{
+  auto arrow_field = garrow_field_get_raw(field);
+

Review Comment:
   ```suggestion
   ```



##########
c_glib/arrow-glib/composite-data-type.cpp:
##########
@@ -767,4 +767,64 @@ garrow_run_end_encoded_data_type_get_value_data_type(
   return garrow_data_type_new_raw(&arrow_value_data_type);
 }
 
+G_DEFINE_TYPE(GArrowFixedSizeListDataType,
+              garrow_fixed_size_list_data_type,
+              GARROW_TYPE_BASE_LIST_DATA_TYPE)
+
+static void
+garrow_fixed_size_list_data_type_init(GArrowFixedSizeListDataType *object)
+{
+}
+
+static void
+garrow_fixed_size_list_data_type_class_init(GArrowFixedSizeListDataTypeClass 
*klass)
+{
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_data_type:
+ * @data_type: The data type of elements.
+ * @list_size: The size of value.
+ *
+ * Returns: (transfer full) : The newly created fixed size list data type.
+ *
+ * Since: 21.0.0
+ */
+GArrowFixedSizeListDataType *
+garrow_fixed_size_list_data_type_new_data_type(GArrowDataType *data_type,
+                                               gint32 list_size)
+{
+  auto arrow_data_type = garrow_data_type_get_raw(data_type);
+
+  auto arrow_fixed_size_list_data_type =
+    std::make_shared<arrow::FixedSizeListType>(arrow_data_type, list_size);
+  return GARROW_FIXED_SIZE_LIST_DATA_TYPE(
+    g_object_new(GARROW_TYPE_FIXED_SIZE_LIST_DATA_TYPE,
+                 "data-type",
+                 &arrow_fixed_size_list_data_type,
+                 nullptr));
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_field:
+ * @field: The field of elements.
+ * @list_size: The size of value.
+ *
+ * Returns: (transfer full) : The newly created fixed size list data type.
+ *
+ * Since: 21.0.0
+ */
+GArrowFixedSizeListDataType *
+garrow_fixed_size_list_data_type_new_field(GArrowField *field, gint32 
list_size)
+{
+  auto arrow_field = garrow_field_get_raw(field);
+
+  auto arrow_fixed_size_list_data_type =
+    std::make_shared<arrow::FixedSizeListType>(arrow_field, list_size);

Review Comment:
   ```suggestion
       arrow::fixed_size_list(arrow_field, list_size);
   ```



##########
c_glib/arrow-glib/composite-data-type.cpp:
##########
@@ -767,4 +767,64 @@ garrow_run_end_encoded_data_type_get_value_data_type(
   return garrow_data_type_new_raw(&arrow_value_data_type);
 }
 
+G_DEFINE_TYPE(GArrowFixedSizeListDataType,
+              garrow_fixed_size_list_data_type,
+              GARROW_TYPE_BASE_LIST_DATA_TYPE)
+
+static void
+garrow_fixed_size_list_data_type_init(GArrowFixedSizeListDataType *object)
+{
+}
+
+static void
+garrow_fixed_size_list_data_type_class_init(GArrowFixedSizeListDataTypeClass 
*klass)
+{
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_data_type:
+ * @data_type: The data type of elements.
+ * @list_size: The size of value.
+ *
+ * Returns: (transfer full) : The newly created fixed size list data type.
+ *
+ * Since: 21.0.0
+ */
+GArrowFixedSizeListDataType *
+garrow_fixed_size_list_data_type_new_data_type(GArrowDataType *data_type,
+                                               gint32 list_size)
+{
+  auto arrow_data_type = garrow_data_type_get_raw(data_type);
+

Review Comment:
   ```suggestion
   ```



##########
c_glib/arrow-glib/composite-data-type.cpp:
##########
@@ -767,4 +767,64 @@ garrow_run_end_encoded_data_type_get_value_data_type(
   return garrow_data_type_new_raw(&arrow_value_data_type);
 }
 
+G_DEFINE_TYPE(GArrowFixedSizeListDataType,
+              garrow_fixed_size_list_data_type,
+              GARROW_TYPE_BASE_LIST_DATA_TYPE)
+
+static void
+garrow_fixed_size_list_data_type_init(GArrowFixedSizeListDataType *object)
+{
+}
+
+static void
+garrow_fixed_size_list_data_type_class_init(GArrowFixedSizeListDataTypeClass 
*klass)
+{
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_data_type:
+ * @data_type: The data type of elements.
+ * @list_size: The size of value.
+ *
+ * Returns: (transfer full) : The newly created fixed size list data type.
+ *
+ * Since: 21.0.0
+ */
+GArrowFixedSizeListDataType *
+garrow_fixed_size_list_data_type_new_data_type(GArrowDataType *data_type,
+                                               gint32 list_size)
+{
+  auto arrow_data_type = garrow_data_type_get_raw(data_type);
+
+  auto arrow_fixed_size_list_data_type =
+    std::make_shared<arrow::FixedSizeListType>(arrow_data_type, list_size);
+  return GARROW_FIXED_SIZE_LIST_DATA_TYPE(
+    g_object_new(GARROW_TYPE_FIXED_SIZE_LIST_DATA_TYPE,
+                 "data-type",
+                 &arrow_fixed_size_list_data_type,
+                 nullptr));

Review Comment:
   ```suggestion
       garrow_data_type_new_raw(&arrow_fixed_size_list_data_type));
   ```



##########
c_glib/arrow-glib/composite-data-type.cpp:
##########
@@ -767,4 +767,64 @@ garrow_run_end_encoded_data_type_get_value_data_type(
   return garrow_data_type_new_raw(&arrow_value_data_type);
 }
 
+G_DEFINE_TYPE(GArrowFixedSizeListDataType,
+              garrow_fixed_size_list_data_type,
+              GARROW_TYPE_BASE_LIST_DATA_TYPE)
+
+static void
+garrow_fixed_size_list_data_type_init(GArrowFixedSizeListDataType *object)
+{
+}
+
+static void
+garrow_fixed_size_list_data_type_class_init(GArrowFixedSizeListDataTypeClass 
*klass)
+{
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_data_type:
+ * @data_type: The data type of elements.
+ * @list_size: The size of value.
+ *
+ * Returns: (transfer full) : The newly created fixed size list data type.
+ *
+ * Since: 21.0.0
+ */
+GArrowFixedSizeListDataType *
+garrow_fixed_size_list_data_type_new_data_type(GArrowDataType *data_type,
+                                               gint32 list_size)
+{
+  auto arrow_data_type = garrow_data_type_get_raw(data_type);
+
+  auto arrow_fixed_size_list_data_type =
+    std::make_shared<arrow::FixedSizeListType>(arrow_data_type, list_size);

Review Comment:
   ```suggestion
     auto arrow_fixed_size_list_data_type =
       arrow::fixed_size_list(arrow_data_type, list_size);
   ```



##########
c_glib/test/test-fixed-size-list-data-type.rb:
##########
@@ -0,0 +1,51 @@
+# 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.
+
+class TestFixedSizeListDataType < Test::Unit::TestCase
+  sub_test_case(".new") do
+    def setup
+      @list_type = Arrow::BooleanDataType.new
+      @list_size = 5
+      @list_name = "bool_field"
+    end
+
+    def test_new_field
+      field = Arrow::Field.new(@list_name, @list_type)
+      data_type = Arrow::FixedSizeListDataType.new(field, @list_size);
+      assert_equal(Arrow::Type::FIXED_SIZE_LIST, data_type.id);
+    end
+
+    def test_new_data_type

Review Comment:
   ```suggestion
       def test_data_type
   ```



##########
c_glib/arrow-glib/composite-data-type.cpp:
##########
@@ -767,4 +767,64 @@ garrow_run_end_encoded_data_type_get_value_data_type(
   return garrow_data_type_new_raw(&arrow_value_data_type);
 }
 
+G_DEFINE_TYPE(GArrowFixedSizeListDataType,
+              garrow_fixed_size_list_data_type,
+              GARROW_TYPE_BASE_LIST_DATA_TYPE)
+
+static void
+garrow_fixed_size_list_data_type_init(GArrowFixedSizeListDataType *object)
+{
+}
+
+static void
+garrow_fixed_size_list_data_type_class_init(GArrowFixedSizeListDataTypeClass 
*klass)
+{
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_data_type:
+ * @data_type: The data type of elements.
+ * @list_size: The size of value.
+ *
+ * Returns: (transfer full) : The newly created fixed size list data type.
+ *
+ * Since: 21.0.0
+ */
+GArrowFixedSizeListDataType *
+garrow_fixed_size_list_data_type_new_data_type(GArrowDataType *data_type,
+                                               gint32 list_size)
+{
+  auto arrow_data_type = garrow_data_type_get_raw(data_type);
+
+  auto arrow_fixed_size_list_data_type =
+    std::make_shared<arrow::FixedSizeListType>(arrow_data_type, list_size);
+  return GARROW_FIXED_SIZE_LIST_DATA_TYPE(
+    g_object_new(GARROW_TYPE_FIXED_SIZE_LIST_DATA_TYPE,
+                 "data-type",
+                 &arrow_fixed_size_list_data_type,
+                 nullptr));
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_field:
+ * @field: The field of elements.
+ * @list_size: The size of value.
+ *
+ * Returns: (transfer full) : The newly created fixed size list data type.
+ *
+ * Since: 21.0.0
+ */
+GArrowFixedSizeListDataType *
+garrow_fixed_size_list_data_type_new_field(GArrowField *field, gint32 
list_size)
+{
+  auto arrow_field = garrow_field_get_raw(field);
+
+  auto arrow_fixed_size_list_data_type =
+    std::make_shared<arrow::FixedSizeListType>(arrow_field, list_size);
+  return GARROW_FIXED_SIZE_LIST_DATA_TYPE(
+    g_object_new(GARROW_TYPE_FIXED_SIZE_LIST_DATA_TYPE,
+                 "data-type",
+                 &arrow_fixed_size_list_data_type,
+                 nullptr));

Review Comment:
   ```suggestion
       garrow_data_type_new_raw(&arrow_fixed_size_list_data_type));
   ```



##########
c_glib/arrow-glib/composite-data-type.cpp:
##########
@@ -767,4 +767,64 @@ garrow_run_end_encoded_data_type_get_value_data_type(
   return garrow_data_type_new_raw(&arrow_value_data_type);
 }
 
+G_DEFINE_TYPE(GArrowFixedSizeListDataType,
+              garrow_fixed_size_list_data_type,
+              GARROW_TYPE_BASE_LIST_DATA_TYPE)
+
+static void
+garrow_fixed_size_list_data_type_init(GArrowFixedSizeListDataType *object)
+{
+}
+
+static void
+garrow_fixed_size_list_data_type_class_init(GArrowFixedSizeListDataTypeClass 
*klass)
+{
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_data_type:
+ * @data_type: The data type of elements.
+ * @list_size: The size of value.
+ *
+ * Returns: (transfer full) : The newly created fixed size list data type.
+ *
+ * Since: 21.0.0
+ */
+GArrowFixedSizeListDataType *
+garrow_fixed_size_list_data_type_new_data_type(GArrowDataType *data_type,
+                                               gint32 list_size)
+{
+  auto arrow_data_type = garrow_data_type_get_raw(data_type);
+
+  auto arrow_fixed_size_list_data_type =
+    std::make_shared<arrow::FixedSizeListType>(arrow_data_type, list_size);
+  return GARROW_FIXED_SIZE_LIST_DATA_TYPE(
+    g_object_new(GARROW_TYPE_FIXED_SIZE_LIST_DATA_TYPE,
+                 "data-type",
+                 &arrow_fixed_size_list_data_type,
+                 nullptr));
+}
+
+/**
+ * garrow_fixed_size_list_data_type_new_field:
+ * @field: The field of elements.
+ * @list_size: The size of value.
+ *
+ * Returns: (transfer full) : The newly created fixed size list data type.

Review Comment:
   ```suggestion
    * Returns: A newly created fixed size list data type.
   ```



-- 
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