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(); }
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(); }
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; }
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; }