hiroyuki-sato commented on code in PR #48554:
URL: https://github.com/apache/arrow/pull/48554#discussion_r2623027787


##########
ruby/red-arrow-format/test/test-file-reader.rb:
##########
@@ -323,6 +339,154 @@ def test_read
                    ],
                    read)
     end
+
+    def test_type
+      assert_equal(:nanosecond, type.unit)
+    end
+  end
+
+  sub_test_case("Timestamp(:second)") do
+    def setup(&block)
+      @timestamp_2019_11_18_00_09_11 = 1574003351
+      @timestamp_2025_12_16_05_33_58 = 1765863238
+      super(&block)
+    end
+
+    def build_array
+      Arrow::TimestampArray.new(:second,
+                                [
+                                  @timestamp_2019_11_18_00_09_11,
+                                  nil,
+                                  @timestamp_2025_12_16_05_33_58,
+                                ])
+    end
+
+    def test_read
+      assert_equal([
+                     {
+                       "value" => [
+                         @timestamp_2019_11_18_00_09_11,
+                         nil,
+                         @timestamp_2025_12_16_05_33_58,
+                       ],
+                     },
+                   ],
+                   read)
+    end
+  end
+
+  sub_test_case("Timestamp(:millisecond)") do
+    def setup(&block)
+      @timestamp_2019_11_18_00_09_11 = 1574003351 * 1_000
+      @timestamp_2025_12_16_05_33_58 = 1765863238 * 1_000
+      super(&block)
+    end
+
+    def build_array
+      Arrow::TimestampArray.new(:second,

Review Comment:
   ```suggestion
         Arrow::TimestampArray.new(:milli,
   ```
   
   `Arrow::TimestampArray.new(:second` returns `value out of range`
   
   
   ```
   [8] pry(main)>       @timestamp_2019_11_18_00_09_11 = 1574003351 * 1_000
   [8] pry(main)>       @timestamp_2025_12_16_05_33_58 = 1765863238 * 1_000
   => 1765863238000
   [9] pry(main)>       Arrow::TimestampArray.new(:second,
   [9] pry(main)>                                 [
   [9] pry(main)>                                   
@timestamp_2019_11_18_00_09_11,
   [9] pry(main)>                                   nil,
   [9] pry(main)>                                   
@timestamp_2025_12_16_05_33_58,
   [9] pry(main)>                                 ])
   => #<Arrow::TimestampArray:0x00000001211f2aa8 ptr=0x0000600003c582e0 [
     <value out of range: 1574003351000>,
     null,
     <value out of range: 1765863238000>
   ]>
   ```



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