@Override
    public RowData nextRecord(RowData reuse) {
        // return the next row
        row.setRowId(this.nextRow++);
        return row;
    }
@Test
    void testReadFileWithTypes(@TempDir File folder) throws IOException {
        String file = new File(folder, "testOrc").getPath();
        int rowSize = 1024;

        prepareReadFileWithTypes(file, rowSize);

        // second test read.
        FileInputSplit split = createSplits(new Path(file), 1)[0];

        int cnt = 0;
        Map<String, Object> partSpec = new HashMap<>();
        partSpec.put("f5", true);
        partSpec.put("f6", new Date(562423));
        partSpec.put("f7", LocalDateTime.of(1999, 1, 1, 1, 1));
        partSpec.put("f8", 6.6);
        partSpec.put("f9", null);
        partSpec.put("f10", null);
        partSpec.put("f11", null);
        partSpec.put("f12", null);
        partSpec.put("f13", null);
        try (OrcColumnarRowSplitReader reader =
                createReader(
                        new int[] {2, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13},
                        new DataType[] {
                            DataTypes.FLOAT(),
                            DataTypes.DOUBLE(),
                            DataTypes.TIMESTAMP(),
                            DataTypes.TINYINT(),
                            DataTypes.SMALLINT(),
                            DataTypes.BOOLEAN(),
                            DataTypes.DATE(),
                            DataTypes.TIMESTAMP(),
                            DataTypes.DOUBLE(),
                            DataTypes.DOUBLE(),
                            DataTypes.INT(),
                            DataTypes.STRING(),
                            DataTypes.TIMESTAMP(),
                            DataTypes.DECIMAL(5, 3)
                        },
                        partSpec,
                        split)) {
            // read and count all rows
            while (!reader.reachedEnd()) {
                RowData row = reader.nextRecord(null);

                if (cnt == rowSize - 1) {
                    assertThat(row.isNullAt(0)).isTrue();
                    assertThat(row.isNullAt(1)).isTrue();
                    assertThat(row.isNullAt(2)).isTrue();
                    assertThat(row.isNullAt(3)).isTrue();
                    assertThat(row.isNullAt(4)).isTrue();
                } else {
                    assertThat(row.isNullAt(0)).isFalse();
                    assertThat(row.isNullAt(1)).isFalse();
                    assertThat(row.isNullAt(2)).isFalse();
                    assertThat(row.isNullAt(3)).isFalse();
                    assertThat(row.isNullAt(4)).isFalse();
                    assertThat(row.getTimestamp(0, 9))
                            .isEqualTo(TimestampData.fromTimestamp(toTimestamp(cnt)));
                    assertThat(row.getFloat(1)).isEqualTo((float) cnt);
                    assertThat(row.getDouble(2)).isEqualTo(cnt);
                    assertThat(row.getByte(3)).isEqualTo((byte) cnt);
                    assertThat(row.getShort(4)).isEqualTo((short) cnt);
                }
                assertThat(row.getBoolean(5)).isTrue();
                assertThat(toSQLDate(row.getInt(6)).toString())
                        .isEqualTo(new Date(562423).toString());

                assertThat(row.getTimestamp(7, 9).toLocalDateTime())
                        .isEqualTo(LocalDateTime.of(1999, 1, 1, 1, 1));

                assertThat(row.getDouble(8)).isEqualTo(6.6);
                assertThat(row.isNullAt(9)).isTrue();
                assertThat(row.isNullAt(10)).isTrue();
                assertThat(row.isNullAt(11)).isTrue();
                assertThat(row.isNullAt(12)).isTrue();
                assertThat(row.isNullAt(13)).isTrue();
                cnt++;
            }
        }
        // check that all rows have been read
        assertThat(cnt).isEqualTo(rowSize);
    }