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(); }
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case NUM_VALUES: return isSetNum_values(); case ENCODING: return isSetEncoding(); case DEFINITION_LEVEL_ENCODING: return isSetDefinition_level_encoding(); case REPETITION_LEVEL_ENCODING: return isSetRepetition_level_encoding(); case STATISTICS: return isSetStatistics(); } throw new IllegalStateException(); }
if (field.type == TType.I32) { this.num_values = iprot.readI32(); setNum_valuesIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); if (!isSetNum_values()) { throw new TProtocolException("Required field 'num_values' was not found in serialized data! Struct: " + toString()); validate();
case 5: // DATA_PAGE_HEADER if (field.type == TType.STRUCT) { this.data_page_header = new DataPageHeader(); this.data_page_header.read(iprot); } else { TProtocolUtil.skip(iprot, field.type);
private PageHeader newDataPageHeader( int uncompressedSize, int compressedSize, int valueCount, parquet.column.statistics.Statistics statistics, parquet.column.Encoding rlEncoding, parquet.column.Encoding dlEncoding, parquet.column.Encoding valuesEncoding) { PageHeader pageHeader = new PageHeader(PageType.DATA_PAGE, uncompressedSize, compressedSize); // TODO: pageHeader.crc = ...; pageHeader.setData_page_header(new DataPageHeader( valueCount, getEncoding(valuesEncoding), getEncoding(dlEncoding), getEncoding(rlEncoding))); if (!statistics.isEmpty()) { pageHeader.getData_page_header().setStatistics(toParquetStatistics(statistics)); } return pageHeader; }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof DataPageHeader) return this.equals((DataPageHeader)that); return false; }
public DataPageHeader deepCopy() { return new DataPageHeader(this); }
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case NUM_VALUES: return isSetNum_values(); case ENCODING: return isSetEncoding(); case DEFINITION_LEVEL_ENCODING: return isSetDefinition_level_encoding(); case REPETITION_LEVEL_ENCODING: return isSetRepetition_level_encoding(); case STATISTICS: return isSetStatistics(); } throw new IllegalStateException(); }
if (field.type == TType.I32) { this.num_values = iprot.readI32(); setNum_valuesIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); if (!isSetNum_values()) { throw new TProtocolException("Required field 'num_values' was not found in serialized data! Struct: " + toString()); validate();
case 5: // DATA_PAGE_HEADER if (field.type == TType.STRUCT) { this.data_page_header = new DataPageHeader(); this.data_page_header.read(iprot); } else { TProtocolUtil.skip(iprot, field.type);
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof DataPageHeader) return this.equals((DataPageHeader)that); return false; }
public DataPageHeader deepCopy() { return new DataPageHeader(this); }
public Object getFieldValue(_Fields field) { switch (field) { case NUM_VALUES: return new Integer(getNum_values()); case ENCODING: return getEncoding(); case DEFINITION_LEVEL_ENCODING: return getDefinition_level_encoding(); case REPETITION_LEVEL_ENCODING: return getRepetition_level_encoding(); case STATISTICS: return getStatistics(); } throw new IllegalStateException(); }
/** * Performs a deep copy on <i>other</i>. */ public DataPageHeader(DataPageHeader other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); this.num_values = other.num_values; if (other.isSetEncoding()) { this.encoding = other.encoding; } if (other.isSetDefinition_level_encoding()) { this.definition_level_encoding = other.definition_level_encoding; } if (other.isSetRepetition_level_encoding()) { this.repetition_level_encoding = other.repetition_level_encoding; } if (other.isSetStatistics()) { this.statistics = new Statistics(other.statistics); } }
if (!(this_present_data_page_header && that_present_data_page_header)) return false; if (!this.data_page_header.equals(that.data_page_header)) return false;
/** * Performs a deep copy on <i>other</i>. */ public PageHeader(PageHeader other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); if (other.isSetType()) { this.type = other.type; } this.uncompressed_page_size = other.uncompressed_page_size; this.compressed_page_size = other.compressed_page_size; this.crc = other.crc; if (other.isSetData_page_header()) { this.data_page_header = new DataPageHeader(other.data_page_header); } if (other.isSetIndex_page_header()) { this.index_page_header = new IndexPageHeader(other.index_page_header); } if (other.isSetDictionary_page_header()) { this.dictionary_page_header = new DictionaryPageHeader(other.dictionary_page_header); } if (other.isSetData_page_header_v2()) { this.data_page_header_v2 = new DataPageHeaderV2(other.data_page_header_v2); } }
public Object getFieldValue(_Fields field) { switch (field) { case NUM_VALUES: return new Integer(getNum_values()); case ENCODING: return getEncoding(); case DEFINITION_LEVEL_ENCODING: return getDefinition_level_encoding(); case REPETITION_LEVEL_ENCODING: return getRepetition_level_encoding(); case STATISTICS: return getStatistics(); } throw new IllegalStateException(); }
/** * Performs a deep copy on <i>other</i>. */ public DataPageHeader(DataPageHeader other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); this.num_values = other.num_values; if (other.isSetEncoding()) { this.encoding = other.encoding; } if (other.isSetDefinition_level_encoding()) { this.definition_level_encoding = other.definition_level_encoding; } if (other.isSetRepetition_level_encoding()) { this.repetition_level_encoding = other.repetition_level_encoding; } if (other.isSetStatistics()) { this.statistics = new Statistics(other.statistics); } }
if (!(this_present_data_page_header && that_present_data_page_header)) return false; if (!this.data_page_header.equals(that.data_page_header)) return false;
/** * Performs a deep copy on <i>other</i>. */ public PageHeader(PageHeader other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); if (other.isSetType()) { this.type = other.type; } this.uncompressed_page_size = other.uncompressed_page_size; this.compressed_page_size = other.compressed_page_size; this.crc = other.crc; if (other.isSetData_page_header()) { this.data_page_header = new DataPageHeader(other.data_page_header); } if (other.isSetIndex_page_header()) { this.index_page_header = new IndexPageHeader(other.index_page_header); } if (other.isSetDictionary_page_header()) { this.dictionary_page_header = new DictionaryPageHeader(other.dictionary_page_header); } if (other.isSetData_page_header_v2()) { this.data_page_header_v2 = new DataPageHeaderV2(other.data_page_header_v2); } }