public Object getFieldValue(_Fields field) { switch (field) { case NUM_ROWS: return getNum_rows(); case SEGMENT_INFO: return getSegment_info(); case BLOCKLET_INDEX_LIST: return getBlocklet_index_list(); case BLOCKLET_INFO_LIST3: return getBlocklet_info_list3(); case DICTIONARY: return getDictionary(); case IS_SORT: return isIs_sort(); case EXTRA_INFO: return getExtra_info(); } throw new IllegalStateException(); }
public FileFooter3 deepCopy() { return new FileFooter3(this); }
case NUM_ROWS: if (value == null) { unsetNum_rows(); } else { setNum_rows((Long)value); unsetSegment_info(); } else { setSegment_info((SegmentInfo)value); unsetBlocklet_index_list(); } else { setBlocklet_index_list((List<BlockletIndex>)value); unsetBlocklet_info_list3(); } else { setBlocklet_info_list3((List<BlockletInfo3>)value); unsetDictionary(); } else { setDictionary((org.apache.carbondata.format.ColumnDictionaryChunk)value); unsetIs_sort(); } else { setIs_sort((Boolean)value); unsetExtra_info(); } else { setExtra_info((Map<String,String>)value);
public DataFileFooter convertDataFileFooter(FileHeader fileHeader, FileFooter3 footer) { DataFileFooter dataFileFooter = new DataFileFooter(); dataFileFooter.setVersionId(ColumnarFormatVersion.valueOf((short) fileHeader.getVersion())); dataFileFooter.setNumberOfRows(footer.getNum_rows()); dataFileFooter.setSegmentInfo(getSegmentInfo(footer.getSegment_info())); dataFileFooter.setSchemaUpdatedTimeStamp(fileHeader.getTime_stamp()); List<ColumnSchema> columnSchemaList = new ArrayList<ColumnSchema>(); footer.getBlocklet_index_list(); List<BlockletIndex> blockletIndexList = new ArrayList<BlockletIndex>(); for (int i = 0; i < leaf_node_indices_Thrift.size(); i++) { footer.getBlocklet_info_list3(); List<BlockletInfo> blockletInfoList = new ArrayList<BlockletInfo>(); for (int i = 0; i < leaf_node_infos_Thrift.size(); i++) {
/** * Below method will be used to get the file footer object * * @param infoList blocklet info * @param blockletIndexs * @param cardinalities cardinlaity of dimension columns * @param numberOfColumns * @return file footer */ private static FileFooter3 getFileFooter3(List<BlockletInfo3> infoList, List<BlockletIndex> blockletIndexs, int[] cardinalities, int numberOfColumns) { SegmentInfo segmentInfo = new SegmentInfo(); segmentInfo.setNum_cols(numberOfColumns); segmentInfo.setColumn_cardinalities(CarbonUtil.convertToIntegerList(cardinalities)); FileFooter3 footer = new FileFooter3(); footer.setNum_rows(getNumberOfRowForFooter(infoList)); footer.setSegment_info(segmentInfo); for (BlockletIndex info : blockletIndexs) { footer.addToBlocklet_index_list(info); } return footer; }
.convertFileFooterVersion3(blockletMetadata, blockletIndex, localCardinality, thriftColumnSchemaList.size()); convertFileMeta.setIs_sort(isSorted); String appName = CarbonProperties.getInstance() .getProperty(CarbonCommonConstants.CARBON_WRITTEN_BY_APPNAME); "DataLoading failed as CARBON_WRITTEN_BY_APPNAME is null"); convertFileMeta.putToExtra_info(CarbonCommonConstants.CARBON_WRITTEN_BY_FOOTER_INFO, appName); convertFileMeta.putToExtra_info(CarbonCommonConstants.CARBON_WRITTEN_VERSION, CarbonVersionConstants.CARBONDATA_VERSION); fillBlockIndexInfoDetails(convertFileMeta.getNum_rows(), carbonDataFileName, currentPosition);
/** * This method return the version details in formatted string by reading from carbondata file * * @param dataFilePath * @return * @throws IOException */ public static String getVersionDetails(String dataFilePath) throws IOException { long fileSize = FileFactory.getCarbonFile(dataFilePath, FileFactory.getFileType(dataFilePath)).getSize(); FileReader fileReader = FileFactory.getFileHolder(FileFactory.getFileType(dataFilePath)); ByteBuffer buffer = fileReader.readByteBuffer(FileFactory.getUpdatedFilePath(dataFilePath), fileSize - 8, 8); fileReader.finish(); CarbonFooterReaderV3 footerReader = new CarbonFooterReaderV3(dataFilePath, buffer.getLong()); FileFooter3 footer = footerReader.readFooterVersion3(); if (null != footer.getExtra_info()) { return footer.getExtra_info().get(CarbonCommonConstants.CARBON_WRITTEN_BY_FOOTER_INFO) + " in version: " + footer.getExtra_info() .get(CarbonCommonConstants.CARBON_WRITTEN_VERSION); } else { return "Version Details are not found in carbondata file"; } } }