private static Set<org.apache.parquet.column.Encoding> readEncodings(List<Encoding> encodings) { Set<org.apache.parquet.column.Encoding> columnEncodings = new HashSet<>(); for (Encoding encoding : encodings) { columnEncodings.add(org.apache.parquet.column.Encoding.valueOf(encoding.name())); } return Collections.unmodifiableSet(columnEncodings); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, DataPageHeader struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.num_values = iprot.readI32(); struct.setNum_valuesIsSet(true); struct.encoding = org.apache.parquet.format.Encoding.findByValue(iprot.readI32()); struct.setEncodingIsSet(true); struct.definition_level_encoding = org.apache.parquet.format.Encoding.findByValue(iprot.readI32()); struct.setDefinition_level_encodingIsSet(true); struct.repetition_level_encoding = org.apache.parquet.format.Encoding.findByValue(iprot.readI32()); struct.setRepetition_level_encodingIsSet(true); java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.statistics = new Statistics(); struct.statistics.read(iprot); struct.setStatisticsIsSet(true); } } }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_num_values = true; list.add(present_num_values); if (present_num_values) list.add(num_values); boolean present_encoding = true && (isSetEncoding()); list.add(present_encoding); if (present_encoding) list.add(encoding.getValue()); boolean present_is_sorted = true && (isSetIs_sorted()); list.add(present_is_sorted); if (present_is_sorted) list.add(is_sorted); return list.hashCode(); }
if (!(this_present_encoding && that_present_encoding)) return false; if (!this.encoding.equals(that.encoding)) return false; if (!(this_present_definition_level_encoding && that_present_definition_level_encoding)) return false; if (!this.definition_level_encoding.equals(that.definition_level_encoding)) return false; if (!(this_present_repetition_level_encoding && that_present_repetition_level_encoding)) return false; if (!this.repetition_level_encoding.equals(that.repetition_level_encoding)) return false;
public Encoding getEncoding(org.apache.parquet.column.Encoding encoding) { return Encoding.valueOf(encoding.name()); }
if (!(this_present_encoding && that_present_encoding)) return false; if (!this.encoding.equals(that.encoding)) return false; if (!(this_present_definition_level_encoding && that_present_definition_level_encoding)) return false; if (!this.definition_level_encoding.equals(that.definition_level_encoding)) return false; if (!(this_present_repetition_level_encoding && that_present_repetition_level_encoding)) return false; if (!this.repetition_level_encoding.equals(that.repetition_level_encoding)) return false;
public Encoding getEncoding(org.apache.parquet.column.Encoding encoding) { return Encoding.valueOf(encoding.name()); }
private static Set<org.apache.parquet.column.Encoding> readEncodings(List<Encoding> encodings) { Set<org.apache.parquet.column.Encoding> columnEncodings = new HashSet<>(); for (Encoding encoding : encodings) { columnEncodings.add(org.apache.parquet.column.Encoding.valueOf(encoding.name())); } return Collections.unmodifiableSet(columnEncodings); }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_page_type = true && (isSetPage_type()); list.add(present_page_type); if (present_page_type) list.add(page_type.getValue()); boolean present_encoding = true && (isSetEncoding()); list.add(present_encoding); if (present_encoding) list.add(encoding.getValue()); boolean present_count = true; list.add(present_count); if (present_count) list.add(count); return list.hashCode(); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, DataPageHeader struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.num_values = iprot.readI32(); struct.setNum_valuesIsSet(true); struct.encoding = org.apache.parquet.format.Encoding.findByValue(iprot.readI32()); struct.setEncodingIsSet(true); struct.definition_level_encoding = org.apache.parquet.format.Encoding.findByValue(iprot.readI32()); struct.setDefinition_level_encodingIsSet(true); struct.repetition_level_encoding = org.apache.parquet.format.Encoding.findByValue(iprot.readI32()); struct.setRepetition_level_encodingIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.statistics = new Statistics(); struct.statistics.read(iprot); struct.setStatisticsIsSet(true); } } }
public boolean equals(DictionaryPageHeader that) { if (that == null) return false; boolean this_present_num_values = true; boolean that_present_num_values = true; if (this_present_num_values || that_present_num_values) { if (!(this_present_num_values && that_present_num_values)) return false; if (this.num_values != that.num_values) return false; } boolean this_present_encoding = true && this.isSetEncoding(); boolean that_present_encoding = true && that.isSetEncoding(); if (this_present_encoding || that_present_encoding) { if (!(this_present_encoding && that_present_encoding)) return false; if (!this.encoding.equals(that.encoding)) return false; } boolean this_present_is_sorted = true && this.isSetIs_sorted(); boolean that_present_is_sorted = true && that.isSetIs_sorted(); if (this_present_is_sorted || that_present_is_sorted) { if (!(this_present_is_sorted && that_present_is_sorted)) return false; if (this.is_sorted != that.is_sorted) return false; } return true; }
public org.apache.parquet.column.Encoding getEncoding(Encoding encoding) { return org.apache.parquet.column.Encoding.valueOf(encoding.name()); }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_num_values = true; list.add(present_num_values); if (present_num_values) list.add(num_values); boolean present_encoding = true && (isSetEncoding()); list.add(present_encoding); if (present_encoding) list.add(encoding.getValue()); boolean present_definition_level_encoding = true && (isSetDefinition_level_encoding()); list.add(present_definition_level_encoding); if (present_definition_level_encoding) list.add(definition_level_encoding.getValue()); boolean present_repetition_level_encoding = true && (isSetRepetition_level_encoding()); list.add(present_repetition_level_encoding); if (present_repetition_level_encoding) list.add(repetition_level_encoding.getValue()); boolean present_statistics = true && (isSetStatistics()); list.add(present_statistics); if (present_statistics) list.add(statistics); return list.hashCode(); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, DictionaryPageHeader struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.num_values = iprot.readI32(); struct.setNum_valuesIsSet(true); struct.encoding = org.apache.parquet.format.Encoding.findByValue(iprot.readI32()); struct.setEncodingIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.is_sorted = iprot.readBool(); struct.setIs_sortedIsSet(true); } } }
if (!(this_present_encoding && that_present_encoding)) return false; if (!this.encoding.equals(that.encoding)) return false;
public org.apache.parquet.column.Encoding getEncoding(Encoding encoding) { return org.apache.parquet.column.Encoding.valueOf(encoding.name()); }
list.add(present_encoding); if (present_encoding) list.add(encoding.getValue());
@Override public void read(org.apache.thrift.protocol.TProtocol prot, DictionaryPageHeader struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.num_values = iprot.readI32(); struct.setNum_valuesIsSet(true); struct.encoding = org.apache.parquet.format.Encoding.findByValue(iprot.readI32()); struct.setEncodingIsSet(true); java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.is_sorted = iprot.readBool(); struct.setIs_sortedIsSet(true); } } }
public boolean equals(PageEncodingStats that) { if (that == null) return false; boolean this_present_page_type = true && this.isSetPage_type(); boolean that_present_page_type = true && that.isSetPage_type(); if (this_present_page_type || that_present_page_type) { if (!(this_present_page_type && that_present_page_type)) return false; if (!this.page_type.equals(that.page_type)) return false; } boolean this_present_encoding = true && this.isSetEncoding(); boolean that_present_encoding = true && that.isSetEncoding(); if (this_present_encoding || that_present_encoding) { if (!(this_present_encoding && that_present_encoding)) return false; if (!this.encoding.equals(that.encoding)) return false; } boolean this_present_count = true; boolean that_present_count = true; if (this_present_count || that_present_count) { if (!(this_present_count && that_present_count)) return false; if (this.count != that.count) return false; } return true; }
private static Optional<DictionaryPage> readDictionaryPage(byte[] data, CompressionCodecName codecName) { try { ByteArrayInputStream inputStream = new ByteArrayInputStream(data); PageHeader pageHeader = Util.readPageHeader(inputStream); if (pageHeader.type != PageType.DICTIONARY_PAGE) { return Optional.empty(); } Slice compressedData = wrappedBuffer(data, data.length - inputStream.available(), pageHeader.getCompressed_page_size()); DictionaryPageHeader dicHeader = pageHeader.getDictionary_page_header(); ParquetEncoding encoding = getParquetEncoding(Encoding.valueOf(dicHeader.getEncoding().name())); int dictionarySize = dicHeader.getNum_values(); return Optional.of(new DictionaryPage(decompress(codecName, compressedData, pageHeader.getUncompressed_page_size()), dictionarySize, encoding)); } catch (IOException ignored) { return Optional.empty(); } }