/** * Get all datamaps of the table for clearing purpose */ public DataMapExprWrapper getAllDataMapsForClear(CarbonTable carbonTable) throws IOException { List<TableDataMap> allDataMapFG = DataMapStoreManager.getInstance().getAllDataMap(carbonTable); DataMapExprWrapper initialExpr = null; if (allDataMapFG.size() > 0) { initialExpr = new DataMapExprWrapperImpl(allDataMapFG.get(0), null); for (int i = 1; i < allDataMapFG.size(); i++) { initialExpr = new AndDataMapExprWrapper(initialExpr, new DataMapExprWrapperImpl(allDataMapFG.get(i), null), null); } } return initialExpr; }
/** * Returns default blocklet datamap * @param carbonTable * @param resolverIntf * @return */ public static DataMapExprWrapper getDefaultDataMap(CarbonTable carbonTable, FilterResolverIntf resolverIntf) { // Return the default datamap if no other datamap exists. return new DataMapExprWrapperImpl( DataMapStoreManager.getInstance().getDefaultDataMap(carbonTable), resolverIntf); }
/** * Return a chosen datamap based on input filter. See {@link DataMapChooser} */ public DataMapExprWrapper choose(FilterResolverIntf filter) { if (filter != null) { Expression expression = filter.getFilterExpression(); // First check for FG datamaps if any exist ExpressionTuple tuple = selectDataMap(expression, fgDataMaps, filter); if (tuple.dataMapExprWrapper == null) { // Check for CG datamap tuple = selectDataMap(expression, cgDataMaps, filter); } if (tuple.dataMapExprWrapper != null) { return tuple.dataMapExprWrapper; } } // Return the default datamap if no other datamap exists. return new DataMapExprWrapperImpl( DataMapStoreManager.getInstance().getDefaultDataMap(carbonTable), filter); }
ExpressionTuple tuple = new ExpressionTuple(); tuple.columnExpressions = columnExpressions; tuple.dataMapExprWrapper = new DataMapExprWrapperImpl(dataMap, resolver); tuple.expression = resolver.getFilterExpression(); return tuple; chooseDataMap(allDataMap, tuple.columnExpressions, filterExpressionTypes); if (dataMap != null) { tuple.dataMapExprWrapper = new DataMapExprWrapperImpl(dataMap, resolver); tuple.filterExpressionTypes.addAll(filterExpressionTypes); tuple.expression = filterResolverIntf.getFilterExpression();