Repository: apache/arrow
File: ruby/red-arrow-format/test/test-file-reader.rb (Ruby)

Code before:
                                ])
    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,
                                [
                                  @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(:microsecond)") do
    def setup(&block)
      @timestamp_2019_11_18_00_09_11 = 1574003351 * 1_000_000
      @timestamp_2025_12_16_05_33_58 = 1765863238 * 1_000_000

Review comment (suggestion):
```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>
]>
```

Code after:
                                ])
    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(:milli,
                                [
                                  @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(:microsecond)") do
    def setup(&block)
      @timestamp_2019_11_18_00_09_11 = 1574003351 * 1_000_000
      @timestamp_2025_12_16_05_33_58 = 1765863238 * 1_000_000