@Override public Metadata readMetadata(HiveWriterVersion hiveWriterVersion, InputStream inputStream) throws OrcCorruptionException { try { return delegate.readMetadata(hiveWriterVersion, inputStream); } catch (IOException | RuntimeException e) { throw propagate(e, "Invalid file metadata"); } }
public Slice writeStripeFooter(StripeFooter footer) throws IOException { metadataWriter.writeStripeFooter(buffer, footer); return getSliceOutput(); }
public Slice writeRowIndexes(List<RowGroupIndex> rowGroupIndexes) throws IOException { metadataWriter.writeRowIndexes(buffer, rowGroupIndexes); return getSliceOutput(); }
private static DwrfSequenceEncoding toSequenceEncoding(OrcType type, DwrfProto.ColumnEncoding columnEncoding) { return new DwrfSequenceEncoding( columnEncoding.getKey(), new ColumnEncoding( toColumnEncodingKind(type.getOrcTypeKind(), columnEncoding.getKind()), columnEncoding.getDictionarySize())); }
public StreamId(Stream stream) { this.column = stream.getColumn(); this.sequence = stream.getSequence(); this.streamKind = stream.getStreamKind(); }
@Override public StripeFooter readStripeFooter(List<OrcType> types, InputStream inputStream) throws IOException { try { return delegate.readStripeFooter(types, inputStream); } catch (IOException e) { throw propagate(e, "Invalid stripe footer"); } }
@Override public MetadataReader createMetadataReader() { return new OrcMetadataReader(); }
static boolean isIndexStream(Stream stream) { return stream.getStreamKind() == ROW_INDEX || stream.getStreamKind() == DICTIONARY_COUNT || stream.getStreamKind() == BLOOM_FILTER || stream.getStreamKind() == BLOOM_FILTER_UTF8; }
@Override public PostScript readPostScript(byte[] data, int offset, int length) throws OrcCorruptionException { try { return delegate.readPostScript(data, offset, length); } catch (IOException | RuntimeException e) { throw propagate(e, "Invalid postscript"); } }
@Override public List<RowGroupIndex> readRowIndexes(HiveWriterVersion hiveWriterVersion, InputStream inputStream) throws OrcCorruptionException { try { return delegate.readRowIndexes(hiveWriterVersion, inputStream); } catch (IOException | RuntimeException e) { throw propagate(e, "Invalid stripe row index"); } }
@Override public Footer readFooter(HiveWriterVersion hiveWriterVersion, InputStream inputStream) throws OrcCorruptionException { try { return delegate.readFooter(hiveWriterVersion, inputStream); } catch (IOException | RuntimeException e) { throw propagate(e, "Invalid file footer"); } }
@Override public MetadataReader createMetadataReader() { return new DwrfMetadataReader(); }
@Override public long size() { return stream.getLength(); }
public Slice writeMetadata(Metadata metadata) throws IOException { metadataWriter.writeMetadata(buffer, metadata); return getSliceOutput(); }
public Slice writeFooter(Footer footer) throws IOException { metadataWriter.writeFooter(buffer, footer); return getSliceOutput(); }
@Override public List<HiveBloomFilter> readBloomFilterIndexes(InputStream inputStream) throws OrcCorruptionException { try { return delegate.readBloomFilterIndexes(inputStream); } catch (IOException | RuntimeException e) { throw propagate(e, "Invalid bloom filter"); } }
@Override public MetadataWriter createMetadataWriter() { return new OrcMetadataWriter(); } },
@Override public MetadataWriter createMetadataWriter() { return new DwrfMetadataWriter(); } };
private static boolean isDictionary(Stream stream, ColumnEncodingKind columnEncoding) { return stream.getStreamKind() == DICTIONARY_DATA || (stream.getStreamKind() == LENGTH && (columnEncoding == DICTIONARY || columnEncoding == DICTIONARY_V2)); }