@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 testParquetAvroRecordReader()
      throws IOException {
    ParquetAvroRecordReader avroRecordReader = new ParquetAvroRecordReader();
    avroRecordReader.init(_dataFile, null, new ParquetRecordReaderConfig());
    testReadParquetFile(avroRecordReader, SAMPLE_RECORDS_SIZE);
  }