for (RowGroup rowGroup : rowGroups) { BlockMetaData blockMetaData = new BlockMetaData(); blockMetaData.setRowCount(rowGroup.getNum_rows()); blockMetaData.setTotalByteSize(rowGroup.getTotal_byte_size()); List<ColumnChunk> columns = rowGroup.getColumns(); validateParquet(!columns.isEmpty(), "No columns in row group: %s", rowGroup); String filePath = columns.get(0).getFile_path();
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof RowGroup) return this.equals((RowGroup)that); return false; }
public Object getFieldValue(_Fields field) { switch (field) { case COLUMNS: return getColumns(); case TOTAL_BYTE_SIZE: return new Long(getTotal_byte_size()); case NUM_ROWS: return new Long(getNum_rows()); case SORTING_COLUMNS: return getSorting_columns(); } throw new IllegalStateException(); }
if (field.type == TType.I64) { this.total_byte_size = iprot.readI64(); setTotal_byte_sizeIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); if (field.type == TType.I64) { this.num_rows = iprot.readI64(); setNum_rowsIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); if (!isSetTotal_byte_size()) { throw new TProtocolException("Required field 'total_byte_size' was not found in serialized data! Struct: " + toString()); if (!isSetNum_rows()) { throw new TProtocolException("Required field 'num_rows' was not found in serialized data! Struct: " + toString()); validate();
/** 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 COLUMNS: return isSetColumns(); case TOTAL_BYTE_SIZE: return isSetTotal_byte_size(); case NUM_ROWS: return isSetNum_rows(); case SORTING_COLUMNS: return isSetSorting_columns(); } throw new IllegalStateException(); }
return false; boolean this_present_columns = true && this.isSetColumns(); boolean that_present_columns = true && that.isSetColumns(); if (this_present_columns || that_present_columns) { if (!(this_present_columns && that_present_columns)) boolean this_present_sorting_columns = true && this.isSetSorting_columns(); boolean that_present_sorting_columns = true && that.isSetSorting_columns(); if (this_present_sorting_columns || that_present_sorting_columns) { if (!(this_present_sorting_columns && that_present_sorting_columns))
public RowGroup deepCopy() { return new RowGroup(this); }
static long getOffset(RowGroup rowGroup) { return getOffset(rowGroup.getColumns().get(0)); } static long getOffset(ColumnChunk columnChunk) {
public void write(TProtocol oprot) throws TException { validate(); oprot.writeFieldEnd(); if (this.sorting_columns != null) { if (isSetSorting_columns()) { oprot.writeFieldBegin(SORTING_COLUMNS_FIELD_DESC);
sb.append(this.num_rows); first = false; if (isSetSorting_columns()) { if (!first) sb.append(", "); sb.append("sorting_columns:");
public Object getFieldValue(_Fields field) { switch (field) { case COLUMNS: return getColumns(); case TOTAL_BYTE_SIZE: return new Long(getTotal_byte_size()); case NUM_ROWS: return new Long(getNum_rows()); case SORTING_COLUMNS: return getSorting_columns(); } throw new IllegalStateException(); }
if (field.type == TType.I64) { this.total_byte_size = iprot.readI64(); setTotal_byte_sizeIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); if (field.type == TType.I64) { this.num_rows = iprot.readI64(); setNum_rowsIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); if (!isSetTotal_byte_size()) { throw new TProtocolException("Required field 'total_byte_size' was not found in serialized data! Struct: " + toString()); if (!isSetNum_rows()) { throw new TProtocolException("Required field 'num_rows' was not found in serialized data! Struct: " + toString()); validate();
/** 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 COLUMNS: return isSetColumns(); case TOTAL_BYTE_SIZE: return isSetTotal_byte_size(); case NUM_ROWS: return isSetNum_rows(); case SORTING_COLUMNS: return isSetSorting_columns(); } throw new IllegalStateException(); }
return false; boolean this_present_columns = true && this.isSetColumns(); boolean that_present_columns = true && that.isSetColumns(); if (this_present_columns || that_present_columns) { if (!(this_present_columns && that_present_columns)) boolean this_present_sorting_columns = true && this.isSetSorting_columns(); boolean that_present_sorting_columns = true && that.isSetSorting_columns(); if (this_present_sorting_columns || that_present_sorting_columns) { if (!(this_present_sorting_columns && that_present_sorting_columns))
public RowGroup deepCopy() { return new RowGroup(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; }
public void write(TProtocol oprot) throws TException { validate(); oprot.writeFieldEnd(); if (this.sorting_columns != null) { if (isSetSorting_columns()) { oprot.writeFieldBegin(SORTING_COLUMNS_FIELD_DESC);
sb.append(this.num_rows); first = false; if (isSetSorting_columns()) { if (!first) sb.append(", "); sb.append("sorting_columns:");