@Override public PostScript readPostScript(byte[] data, int offset, int length) throws IOException { CodedInputStream input = CodedInputStream.newInstance(data, offset, length); DwrfProto.PostScript postScript = DwrfProto.PostScript.parseFrom(input); HiveWriterVersion writerVersion = postScript.hasWriterVersion() && postScript.getWriterVersion() > 0 ? ORC_HIVE_8732 : ORIGINAL; return new PostScript( ImmutableList.of(), postScript.getFooterLength(), 0, toCompression(postScript.getCompression()), postScript.getCompressionBlockSize(), writerVersion); }
checkOrcVersion(orcDataSource, postScript.getVersion()); validateWrite(validation -> validation.getVersion().equals(postScript.getVersion()), "Unexpected version"); this.bufferSize = toIntExact(postScript.getCompressionBlockSize()); this.compressionKind = postScript.getCompression(); this.decompressor = createOrcDecompressor(orcDataSource.getId(), compressionKind, bufferSize); validateWrite(validation -> validation.getCompression() == compressionKind, "Unexpected compression"); this.hiveWriterVersion = postScript.getHiveWriterVersion(); int footerSize = toIntExact(postScript.getFooterLength()); int metadataSize = toIntExact(postScript.getMetadataLength());
checkOrcVersion(orcDataSource, postScript.getVersion()); this.compressionKind = postScript.getCompression(); this.bufferSize = Ints.checkedCast(postScript.getCompressionBlockSize()); int footerSize = Ints.checkedCast(postScript.getFooterLength()); int metadataSize = Ints.checkedCast(postScript.getMetadataLength());
@Override public PostScript readPostScript(byte[] data, int offset, int length) throws IOException { CodedInputStream input = CodedInputStream.newInstance(data, offset, length); OrcProto.PostScript postScript = OrcProto.PostScript.parseFrom(input); return new PostScript( postScript.getVersionList(), postScript.getFooterLength(), postScript.getMetadataLength(), toCompression(postScript.getCompression()), postScript.getCompressionBlockSize(), toHiveWriterVersion(postScript.getWriterVersion())); }
checkOrcVersion(orcDataSource, postScript.getVersion()); validateWrite(validation -> validation.getVersion().equals(postScript.getVersion()), "Unexpected version"); this.bufferSize = toIntExact(postScript.getCompressionBlockSize()); this.compressionKind = postScript.getCompression(); this.decompressor = createOrcDecompressor(orcDataSource.getId(), compressionKind, bufferSize); validateWrite(validation -> validation.getCompression() == compressionKind, "Unexpected compression"); this.hiveWriterVersion = postScript.getHiveWriterVersion(); int footerSize = toIntExact(postScript.getFooterLength()); int metadataSize = toIntExact(postScript.getMetadataLength());
@Override public PostScript readPostScript(byte[] data, int offset, int length) throws IOException { CodedInputStream input = CodedInputStream.newInstance(data, offset, length); OrcProto.PostScript postScript = OrcProto.PostScript.parseFrom(input); return new PostScript( ImmutableList.<Integer>of(), postScript.getFooterLength(), 0, toCompression(postScript.getCompression()), postScript.getCompressionBlockSize()); }
@Override public PostScript readPostScript(byte[] data, int offset, int length) throws IOException { CodedInputStream input = CodedInputStream.newInstance(data, offset, length); DwrfProto.PostScript postScript = DwrfProto.PostScript.parseFrom(input); HiveWriterVersion writerVersion = postScript.hasWriterVersion() && postScript.getWriterVersion() > 0 ? ORC_HIVE_8732 : ORIGINAL; return new PostScript( ImmutableList.of(), postScript.getFooterLength(), 0, toCompression(postScript.getCompression()), postScript.getCompressionBlockSize(), writerVersion); }
@Override public PostScript readPostScript(byte[] data, int offset, int length) throws IOException { CodedInputStream input = CodedInputStream.newInstance(data, offset, length); OrcProto.PostScript postScript = OrcProto.PostScript.parseFrom(input); return new PostScript( postScript.getVersionList(), postScript.getFooterLength(), postScript.getMetadataLength(), toCompression(postScript.getCompression()), postScript.getCompressionBlockSize()); }
@Override public PostScript readPostScript(byte[] data, int offset, int length) throws IOException { CodedInputStream input = CodedInputStream.newInstance(data, offset, length); OrcProto.PostScript postScript = OrcProto.PostScript.parseFrom(input); return new PostScript( postScript.getVersionList(), postScript.getFooterLength(), postScript.getMetadataLength(), toCompression(postScript.getCompression()), postScript.getCompressionBlockSize(), toHiveWriterVersion(postScript.getWriterVersion())); }