List<ColumnChunk> columns = rowGroup.getColumns(); validateParquet(!columns.isEmpty(), "No columns in row group: %s", rowGroup); String filePath = columns.get(0).getFile_path(); for (ColumnChunk columnChunk : columns) { validateParquet( (filePath == null && columnChunk.getFile_path() == null) || (filePath != null && filePath.equals(columnChunk.getFile_path())), "all column chunks of the same row group must be in the same file"); ColumnMetaData metaData = columnChunk.meta_data;
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof ColumnChunk) return this.equals((ColumnChunk)that); return false; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_PATH: if (value == null) { unsetFile_path(); } else { setFile_path((String)value); } break; case FILE_OFFSET: if (value == null) { unsetFile_offset(); } else { setFile_offset((Long)value); } break; case META_DATA: if (value == null) { unsetMeta_data(); } else { setMeta_data((ColumnMetaData)value); } break; } }
/** 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 FILE_PATH: return isSetFile_path(); case FILE_OFFSET: return isSetFile_offset(); case META_DATA: return isSetMeta_data(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case FILE_PATH: return getFile_path(); case FILE_OFFSET: return new Long(getFile_offset()); case META_DATA: return getMeta_data(); } throw new IllegalStateException(); }
/** * 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); } }
if (field.type == TType.I64) { this.file_offset = iprot.readI64(); setFile_offsetIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); if (!isSetFile_offset()) { throw new TProtocolException("Required field 'file_offset' was not found in serialized data! Struct: " + toString()); validate();
public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.file_path != null) { if (isSetFile_path()) { oprot.writeFieldBegin(FILE_PATH_FIELD_DESC); oprot.writeString(this.file_path); oprot.writeFieldEnd(); } } oprot.writeFieldBegin(FILE_OFFSET_FIELD_DESC); oprot.writeI64(this.file_offset); oprot.writeFieldEnd(); if (this.meta_data != null) { if (isSetMeta_data()) { oprot.writeFieldBegin(META_DATA_FIELD_DESC); this.meta_data.write(oprot); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
_elem18 = new ColumnChunk(); _elem18.read(iprot); this.columns.add(_elem18);
public ColumnChunk deepCopy() { return new ColumnChunk(this); }
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; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_PATH: if (value == null) { unsetFile_path(); } else { setFile_path((String)value); } break; case FILE_OFFSET: if (value == null) { unsetFile_offset(); } else { setFile_offset((Long)value); } break; case META_DATA: if (value == null) { unsetMeta_data(); } else { setMeta_data((ColumnMetaData)value); } break; } }
/** 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 FILE_PATH: return isSetFile_path(); case FILE_OFFSET: return isSetFile_offset(); case META_DATA: return isSetMeta_data(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case FILE_PATH: return getFile_path(); case FILE_OFFSET: return new Long(getFile_offset()); case META_DATA: return getMeta_data(); } throw new IllegalStateException(); }
/** * 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); } }
if (field.type == TType.I64) { this.file_offset = iprot.readI64(); setFile_offsetIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); if (!isSetFile_offset()) { throw new TProtocolException("Required field 'file_offset' was not found in serialized data! Struct: " + toString()); validate();
public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.file_path != null) { if (isSetFile_path()) { oprot.writeFieldBegin(FILE_PATH_FIELD_DESC); oprot.writeString(this.file_path); oprot.writeFieldEnd(); } } oprot.writeFieldBegin(FILE_OFFSET_FIELD_DESC); oprot.writeI64(this.file_offset); oprot.writeFieldEnd(); if (this.meta_data != null) { if (isSetMeta_data()) { oprot.writeFieldBegin(META_DATA_FIELD_DESC); this.meta_data.write(oprot); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
_elem14 = new ColumnChunk(); _elem14.read(iprot); this.columns.add(_elem14);
public ColumnChunk deepCopy() { return new ColumnChunk(this); }
static FileMetaData filterFileMetaData(FileMetaData metaData, RangeMetadataFilter filter) { List<RowGroup> rowGroups = metaData.getRow_groups(); List<RowGroup> newRowGroups = new ArrayList<RowGroup>(); for (RowGroup rowGroup : rowGroups) { long totalSize = 0; long startIndex = getOffset(rowGroup.getColumns().get(0)); for (ColumnChunk col : rowGroup.getColumns()) { totalSize += col.getMeta_data().getTotal_compressed_size(); } long midPoint = startIndex + totalSize / 2; if (filter.contains(midPoint)) { newRowGroups.add(rowGroup); } } metaData.setRow_groups(newRowGroups); return metaData; }