@Override
    public Reader<E> restoreReader(
            Configuration config,
            FSDataInputStream stream,
            long restoredOffset,
            long fileLen,
            long splitEnd)
            throws IOException {

        // current version does not support splitting.
        checkNotSplit(fileLen, splitEnd);

        checkArgument(
                restoredOffset == CheckpointedPosition.NO_OFFSET,
                "The restoredOffset should always be NO_OFFSET");

        return createReader(config, stream, fileLen, splitEnd);
    }
@Test
    void testRestoreGenericReaderWithWrongOffset() {
        assertThatThrownBy(
                        () ->
                                restoreReader(
                                        AvroParquetReaders.forGenericRecord(schema),
                                        new Configuration(),
                                        userPath,
                                        10,
                                        0,
                                        userPath.getFileSystem().getFileStatus(userPath).getLen()))
                .isInstanceOf(IllegalArgumentException.class);
    }