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


##########
c_glib/test/test-table.rb:
##########
@@ -243,6 +243,37 @@ def test_combine_chunks
                    all_values)
     end
 
+    sub_test_case("#validate") do
+      def setup
+        @id_field = Arrow::Field.new("id", Arrow::UInt8DataType.new)
+        @name_field = Arrow::Field.new("name", Arrow::StringDataType.new)
+        @schema = Arrow::Schema.new([@id_field, @name_field])
+
+        @id_array = build_uint_array([1])
+        @name_array = build_string_array(["abc"])
+        @arrays = [@id_value, @name_value]
+      end
+
+      def test_valid
+        table = Arrow::Table.new(@schema, @values)
+
+        assert do
+          table.validate
+        end
+      end
+
+      def test_invalid
+        message = "[table][validate]: Invalid: " +
+          "Column 1 named name expected length 1 but got length 2"
+
+        invalid_values = [@id_value, build_string_array(["abc", "def"])]

Review Comment:
   ```suggestion
           invalid_values = [@id_array, build_string_array(["abc", "def"])]
   ```



##########
c_glib/test/test-table.rb:
##########
@@ -243,6 +243,37 @@ def test_combine_chunks
                    all_values)
     end
 
+    sub_test_case("#validate") do
+      def setup
+        @id_field = Arrow::Field.new("id", Arrow::UInt8DataType.new)
+        @name_field = Arrow::Field.new("name", Arrow::StringDataType.new)
+        @schema = Arrow::Schema.new([@id_field, @name_field])
+
+        @id_array = build_uint_array([1])
+        @name_array = build_string_array(["abc"])
+        @arrays = [@id_value, @name_value]

Review Comment:
   ```suggestion
           @arrays = [@id_array, @name_array]
   ```



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