@Override public SeekableInputStream newStream() throws IOException { return stream(file.newStream()); } }
public static TableMetadata read(TableOperations ops, InputFile file) { try { InputStream is = file.location().endsWith("gz") ? new GzipCompressorInputStream(file.newStream()): file.newStream(); return fromJson(ops, file, JsonUtil.mapper().readValue(is, JsonNode.class)); } catch (IOException e) { throw new RuntimeIOException(e, "Failed to read file: %s", file); } }
private DataFileReader<D> newFileReader() { try { return (DataFileReader<D>) DataFileReader.openReader( AvroIO.stream(file.newStream(), file.getLength()), reader); } catch (IOException e) { throw new RuntimeIOException(e, "Failed to open file: %s", file); } }