@Test public void testGetFileReader() throws IOException { final Configuration hadoopConf = new Configuration(); final Path parquetPath = new Path("/partition/path/f1_1-0-1_000.parquet"); HoodieFileReader<IndexedRecord> parquetReader = HoodieFileReaderFactory.getFileReader(hadoopConf, parquetPath); assertTrue(parquetReader instanceof HoodieParquetReader); final Path logPath = new Path("/partition/path/f.b51192a8-574b-4a85-b246-bcfec03ac8bf_100.log.2_1-0-1"); final Throwable thrown = assertThrows(UnsupportedOperationException.class, () -> { HoodieFileReader<IndexedRecord> logWriter = HoodieFileReaderFactory.getFileReader(hadoopConf, logPath); }, "should fail since log storage reader is not supported yet."); assertTrue(thrown.getMessage().contains("format not supported yet.")); }
public static <T extends HoodieRecordPayload, R extends IndexedRecord> HoodieFileReader<R> getFileReader( Configuration conf, Path path) throws IOException { final String extension = FSUtils.getFileExtension(path.toString()); if (PARQUET.getFileExtension().equals(extension)) { return newParquetFileReader(conf, path); } if (HFILE.getFileExtension().equals(extension)) { return newHFileFileReader(conf, path); } throw new UnsupportedOperationException(extension + " format not supported yet."); }
HoodieFileReaderFactory { public static <T extends HoodieRecordPayload, R extends IndexedRecord> HoodieFileReader<R> getFileReader( Configuration conf, Path path) throws IOException { final String extension = FSUtils.getFileExtension(path.toString()); if (PARQUET.getFileExtension().equals(extension)) { return newParquetFileReader(conf, path); } if (HFILE.getFileExtension().equals(extension)) { return newHFileFileReader(conf, path); } throw new UnsupportedOperationException(extension + " format not supported yet."); } }
HoodieFileReaderFactory { public static <T extends HoodieRecordPayload, R extends IndexedRecord> HoodieFileReader<R> getFileReader( Configuration conf, Path path) throws IOException { final String extension = FSUtils.getFileExtension(path.toString()); if (PARQUET.getFileExtension().equals(extension)) { return newParquetFileReader(conf, path); } if (HFILE.getFileExtension().equals(extension)) { return newHFileFileReader(conf, path); } throw new UnsupportedOperationException(extension + " format not supported yet."); }  }
HoodieFileReaderFactory { public static <T extends HoodieRecordPayload, R extends IndexedRecord> HoodieFileReader<R> getFileReader( Configuration conf, Path path) throws IOException { final String extension = FSUtils.getFileExtension(path.toString()); if (PARQUET.getFileExtension().equals(extension)) { return newParquetFileReader(conf, path); } if (HFILE.getFileExtension().equals(extension)) { return newHFileFileReader(conf, path); } throw new UnsupportedOperationException(extension + " format not supported yet."); }  static HoodieFileReader<R> getFileReader(
      Configuration conf, Path path); }
HoodieFileReaderFactory { public static <T extends HoodieRecordPayload, R extends IndexedRecord> HoodieFileReader<R> getFileReader( Configuration conf, Path path) throws IOException { final String extension = FSUtils.getFileExtension(path.toString()); if (PARQUET.getFileExtension().equals(extension)) { return newParquetFileReader(conf, path); } if (HFILE.getFileExtension().equals(extension)) { return newHFileFileReader(conf, path); } throw new UnsupportedOperationException(extension + " format not supported yet."); }  static HoodieFileReader<R> getFileReader(
      Configuration conf, Path path);  }