@Override
  public void init(File dataFile, @Nullable Set<String> fieldsToRead, @Nullable RecordReaderConfig recordReaderConfig)
      throws IOException {
    File parquetFile = RecordReaderUtils.unpackIfRequired(dataFile, EXTENSION);
    if (recordReaderConfig != null && ((ParquetRecordReaderConfig) recordReaderConfig).useParquetAvroRecordReader()) {
      _internalParquetRecordReader = new ParquetAvroRecordReader();
    } else if (recordReaderConfig != null
        && ((ParquetRecordReaderConfig) recordReaderConfig).useParquetNativeRecordReader()) {
      _useAvroParquetRecordReader = false;
      _internalParquetRecordReader = new ParquetNativeRecordReader();
    } else {
      // No reader type specified. Determine using file metadata
      if (ParquetUtils.hasAvroSchemaInFileMetadata(new Path(parquetFile.getAbsolutePath()))) {
        _internalParquetRecordReader = new ParquetAvroRecordReader();
      } else {
        _useAvroParquetRecordReader = false;
        _internalParquetRecordReader = new ParquetNativeRecordReader();
      }
    }
    _internalParquetRecordReader.init(parquetFile, fieldsToRead, recordReaderConfig);
  }
@Test
  public void testParquetNativeRecordReader()
      throws IOException {
    ParquetNativeRecordReader nativeRecordReader = new ParquetNativeRecordReader();
    nativeRecordReader.init(
        new File(getClass().getClassLoader().getResource("test-file-with-int96-and-decimal.snappy.parquet").getFile()),
        ImmutableSet.of(), new ParquetRecordReaderConfig());
    testReadParquetFile(nativeRecordReader, 1965);
    nativeRecordReader.init(new File(getClass().getClassLoader().getResource("airlineStats.zstd.parquet").getFile()),
        ImmutableSet.of(), new ParquetRecordReaderConfig());
    testReadParquetFile(nativeRecordReader, 19492);
    nativeRecordReader.init(_dataFile, ImmutableSet.of(), new ParquetRecordReaderConfig());
    testReadParquetFile(nativeRecordReader, SAMPLE_RECORDS_SIZE);
  }