public ColumnMetaData deepCopy() { return new ColumnMetaData(this); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof ColumnMetaData) return this.equals((ColumnMetaData)that); return false; }
public Object getFieldValue(_Fields field) { switch (field) { case TYPE: return getType(); case ENCODINGS: return getEncodings(); case PATH_IN_SCHEMA: return getPath_in_schema(); case CODEC: return getCodec(); case NUM_VALUES: return new Long(getNum_values()); case TOTAL_UNCOMPRESSED_SIZE: return new Long(getTotal_uncompressed_size()); case TOTAL_COMPRESSED_SIZE: return new Long(getTotal_compressed_size()); case KEY_VALUE_METADATA: return getKey_value_metadata(); case DATA_PAGE_OFFSET: return new Long(getData_page_offset()); case INDEX_PAGE_OFFSET: return new Long(getIndex_page_offset()); case DICTIONARY_PAGE_OFFSET: return new Long(getDictionary_page_offset()); case STATISTICS: return getStatistics(); } throw new IllegalStateException(); }
static long getOffset(ColumnChunk columnChunk) { ColumnMetaData md = columnChunk.getMeta_data(); long offset = md.getData_page_offset(); if (md.isSetDictionary_page_offset() && offset > md.getDictionary_page_offset()) { offset = md.getDictionary_page_offset(); } return offset; }
case 3: // META_DATA if (field.type == TType.STRUCT) { this.meta_data = new ColumnMetaData(); this.meta_data.read(iprot); } else { TProtocolUtil.skip(iprot, field.type);
private void addRowGroup(ParquetMetadata parquetMetadata, List<RowGroup> rowGroups, BlockMetaData block) { //rowGroup.total_byte_size = ; List<ColumnChunkMetaData> columns = block.getColumns(); List<ColumnChunk> parquetColumns = new ArrayList<ColumnChunk>(); for (ColumnChunkMetaData columnMetaData : columns) { ColumnChunk columnChunk = new ColumnChunk(columnMetaData.getFirstDataPageOffset()); // verify this is the right offset columnChunk.file_path = block.getPath(); // they are in the same file for now columnChunk.meta_data = new parquet.format.ColumnMetaData( getType(columnMetaData.getType()), toFormatEncodings(columnMetaData.getEncodings()), Arrays.asList(columnMetaData.getPath().toArray()), columnMetaData.getCodec().getParquetCompressionCodec(), columnMetaData.getValueCount(), columnMetaData.getTotalUncompressedSize(), columnMetaData.getTotalSize(), columnMetaData.getFirstDataPageOffset()); columnChunk.meta_data.dictionary_page_offset = columnMetaData.getDictionaryPageOffset(); if (!columnMetaData.getStatistics().isEmpty()) { columnChunk.meta_data.setStatistics(toParquetStatistics(columnMetaData.getStatistics())); } // columnChunk.meta_data.index_page_offset = ; // columnChunk.meta_data.key_value_metadata = ; // nothing yet parquetColumns.add(columnChunk); } RowGroup rowGroup = new RowGroup(parquetColumns, block.getTotalByteSize(), block.getRowCount()); rowGroups.add(rowGroup); }
case 3: // META_DATA if (field.type == TType.STRUCT) { this.meta_data = new ColumnMetaData(); this.meta_data.read(iprot); } else { TProtocolUtil.skip(iprot, field.type);
public Object getFieldValue(_Fields field) { switch (field) { case TYPE: return getType(); return getEncodings(); return getPath_in_schema(); return getCodec(); return new Long(getNum_values()); return new Long(getTotal_uncompressed_size()); return new Long(getTotal_compressed_size()); return getKey_value_metadata(); return new Long(getData_page_offset()); return new Long(getIndex_page_offset()); return new Long(getDictionary_page_offset()); return getStatistics(); return getEncoding_stats();
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof ColumnMetaData) return this.equals((ColumnMetaData)that); return false; }
public ColumnMetaData deepCopy() { return new ColumnMetaData(this); }
public boolean equals(ColumnChunk that) { if (that == null) return false; boolean this_present_file_path = true && this.isSetFile_path(); boolean that_present_file_path = true && that.isSetFile_path(); if (this_present_file_path || that_present_file_path) { if (!(this_present_file_path && that_present_file_path)) return false; if (!this.file_path.equals(that.file_path)) return false; } boolean this_present_file_offset = true; boolean that_present_file_offset = true; if (this_present_file_offset || that_present_file_offset) { if (!(this_present_file_offset && that_present_file_offset)) return false; if (this.file_offset != that.file_offset) return false; } boolean this_present_meta_data = true && this.isSetMeta_data(); boolean that_present_meta_data = true && that.isSetMeta_data(); if (this_present_meta_data || that_present_meta_data) { if (!(this_present_meta_data && that_present_meta_data)) return false; if (!this.meta_data.equals(that.meta_data)) return false; } return true; }
/** * Performs a deep copy on <i>other</i>. */ public ColumnChunk(ColumnChunk other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); if (other.isSetFile_path()) { this.file_path = other.file_path; } this.file_offset = other.file_offset; if (other.isSetMeta_data()) { this.meta_data = new ColumnMetaData(other.meta_data); } }
public boolean equals(ColumnChunk that) { if (that == null) return false; boolean this_present_file_path = true && this.isSetFile_path(); boolean that_present_file_path = true && that.isSetFile_path(); if (this_present_file_path || that_present_file_path) { if (!(this_present_file_path && that_present_file_path)) return false; if (!this.file_path.equals(that.file_path)) return false; } boolean this_present_file_offset = true; boolean that_present_file_offset = true; if (this_present_file_offset || that_present_file_offset) { if (!(this_present_file_offset && that_present_file_offset)) return false; if (this.file_offset != that.file_offset) return false; } boolean this_present_meta_data = true && this.isSetMeta_data(); boolean that_present_meta_data = true && that.isSetMeta_data(); if (this_present_meta_data || that_present_meta_data) { if (!(this_present_meta_data && that_present_meta_data)) return false; if (!this.meta_data.equals(that.meta_data)) return false; } return true; }
/** * Performs a deep copy on <i>other</i>. */ public ColumnChunk(ColumnChunk other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); if (other.isSetFile_path()) { this.file_path = other.file_path; } this.file_offset = other.file_offset; if (other.isSetMeta_data()) { this.meta_data = new ColumnMetaData(other.meta_data); } }