private static Set<parquet.column.Encoding> readEncodings(List<Encoding> encodings) { Set<parquet.column.Encoding> columnEncodings = new HashSet<>(); for (Encoding encoding : encodings) { columnEncodings.add(parquet.column.Encoding.valueOf(encoding.name())); } return Collections.unmodifiableSet(columnEncodings); }
@Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_num_values = true; builder.append(present_num_values); if (present_num_values) builder.append(num_values); boolean present_encoding = true && (isSetEncoding()); builder.append(present_encoding); if (present_encoding) builder.append(encoding.getValue()); boolean present_is_sorted = true && (isSetIs_sorted()); builder.append(present_is_sorted); if (present_is_sorted) builder.append(is_sorted); return builder.toHashCode(); }
case 2: // ENCODING if (field.type == TType.I32) { this.encoding = Encoding.findByValue(iprot.readI32()); } else { TProtocolUtil.skip(iprot, field.type); case 3: // DEFINITION_LEVEL_ENCODING if (field.type == TType.I32) { this.definition_level_encoding = Encoding.findByValue(iprot.readI32()); } else { TProtocolUtil.skip(iprot, field.type); case 4: // REPETITION_LEVEL_ENCODING if (field.type == TType.I32) { this.repetition_level_encoding = Encoding.findByValue(iprot.readI32()); } else { TProtocolUtil.skip(iprot, field.type);
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(parquet.column.Encoding encoding) { return Encoding.valueOf(encoding.name()); }
@Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_num_values = true; builder.append(present_num_values); if (present_num_values) builder.append(num_values); boolean present_encoding = true && (isSetEncoding()); builder.append(present_encoding); if (present_encoding) builder.append(encoding.getValue()); boolean present_definition_level_encoding = true && (isSetDefinition_level_encoding()); builder.append(present_definition_level_encoding); if (present_definition_level_encoding) builder.append(definition_level_encoding.getValue()); boolean present_repetition_level_encoding = true && (isSetRepetition_level_encoding()); builder.append(present_repetition_level_encoding); if (present_repetition_level_encoding) builder.append(repetition_level_encoding.getValue()); boolean present_statistics = true && (isSetStatistics()); builder.append(present_statistics); if (present_statistics) builder.append(statistics); return builder.toHashCode(); }
case 2: // ENCODING if (field.type == TType.I32) { this.encoding = Encoding.findByValue(iprot.readI32()); } else { TProtocolUtil.skip(iprot, field.type); case 3: // DEFINITION_LEVEL_ENCODING if (field.type == TType.I32) { this.definition_level_encoding = Encoding.findByValue(iprot.readI32()); } else { TProtocolUtil.skip(iprot, field.type); case 4: // REPETITION_LEVEL_ENCODING if (field.type == TType.I32) { this.repetition_level_encoding = Encoding.findByValue(iprot.readI32()); } else { TProtocolUtil.skip(iprot, field.type);
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;
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(); } }
@Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_page_type = true && (isSetPage_type()); builder.append(present_page_type); if (present_page_type) builder.append(page_type.getValue()); boolean present_encoding = true && (isSetEncoding()); builder.append(present_encoding); if (present_encoding) builder.append(encoding.getValue()); boolean present_count = true; builder.append(present_count); if (present_count) builder.append(count); return builder.toHashCode(); }
case 2: // ENCODING if (field.type == TType.I32) { this.encoding = Encoding.findByValue(iprot.readI32()); } else { TProtocolUtil.skip(iprot, field.type);
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; }
private long readDataPageV1(PageHeader pageHeader, int uncompressedPageSize, int compressedPageSize, List<DataPage> pages) { DataPageHeader dataHeaderV1 = pageHeader.getData_page_header(); pages.add(new DataPageV1( getSlice(compressedPageSize), dataHeaderV1.getNum_values(), uncompressedPageSize, MetadataReader.readStats( dataHeaderV1.getStatistics(), descriptor.getColumnDescriptor().getType()), getParquetEncoding(Encoding.valueOf(dataHeaderV1.getRepetition_level_encoding().name())), getParquetEncoding(Encoding.valueOf(dataHeaderV1.getDefinition_level_encoding().name())), getParquetEncoding(Encoding.valueOf(dataHeaderV1.getEncoding().name())))); return dataHeaderV1.getNum_values(); }
builder.append(present_encoding); if (present_encoding) builder.append(encoding.getValue());
case 2: // ENCODING if (field.type == TType.I32) { this.encoding = Encoding.findByValue(iprot.readI32()); } else { TProtocolUtil.skip(iprot, field.type);
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; }
private DictionaryPage readDictionaryPage(PageHeader pageHeader, int uncompressedPageSize, int compressedPageSize) { DictionaryPageHeader dicHeader = pageHeader.getDictionary_page_header(); return new DictionaryPage( getSlice(compressedPageSize), uncompressedPageSize, dicHeader.getNum_values(), getParquetEncoding(Encoding.valueOf(dicHeader.getEncoding().name()))); }
@Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_num_values = true; builder.append(present_num_values); if (present_num_values) builder.append(num_values); boolean present_encoding = true && (isSetEncoding()); builder.append(present_encoding); if (present_encoding) builder.append(encoding.getValue()); boolean present_definition_level_encoding = true && (isSetDefinition_level_encoding()); builder.append(present_definition_level_encoding); if (present_definition_level_encoding) builder.append(definition_level_encoding.getValue()); boolean present_repetition_level_encoding = true && (isSetRepetition_level_encoding()); builder.append(present_repetition_level_encoding); if (present_repetition_level_encoding) builder.append(repetition_level_encoding.getValue()); boolean present_statistics = true && (isSetStatistics()); builder.append(present_statistics); if (present_statistics) builder.append(statistics); return builder.toHashCode(); }
case 2: // ENCODING if (field.type == TType.I32) { this.encoding = Encoding.findByValue(iprot.readI32()); } else { TProtocolUtil.skip(iprot, field.type);
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; }