private List<Integer> getDirectSurrogateValues(ColumnExpression columnExpression) throws FilterUnsupportedException { List<ExpressionResult> listOfExpressionResults = new ArrayList<ExpressionResult>(20); DirectDictionaryGenerator directDictionaryGenerator = DirectDictionaryKeyGeneratorFactory .getDirectDictionaryGenerator(columnExpression.getDimension().getDataType()); if (this.getFilterExpression() instanceof BinaryConditionalExpression) { listOfExpressionResults = ((BinaryConditionalExpression) this.getFilterExpression()).getLiterals(); } List<Integer> filterValuesList = new ArrayList<Integer>(20); try { // if any filter member provided by user is invalid throw error else // system can display inconsistent result. for (ExpressionResult result : listOfExpressionResults) { filterValuesList.add(directDictionaryGenerator .generateDirectSurrogateKey(result.getString(), CarbonCommonConstants.CARBON_TIMESTAMP_DEFAULT_FORMAT)); } } catch (FilterIllegalMemberException e) { throw new FilterUnsupportedException(e); } return filterValuesList; }
private List<Object> getMeasureRangeValues(CarbonMeasure carbonMeasure) { List<ExpressionResult> listOfExpressionResults = new ArrayList<ExpressionResult>(20); if (this.getFilterExpression() instanceof BinaryConditionalExpression) { listOfExpressionResults = ((BinaryConditionalExpression) this.getFilterExpression()).getLiterals(); } List<Object> filterValuesList = new ArrayList<>(20); boolean invalidRowsPresent = false; for (ExpressionResult result : listOfExpressionResults) { try { if (result.getString() == null) { filterValuesList.add(null); continue; } filterValuesList.add(DataTypeUtil.getMeasureValueBasedOnDataType(result.getString(), result.getDataType(), carbonMeasure.getScale(), carbonMeasure.getPrecision())); } catch (FilterIllegalMemberException e) { // Any invalid member while evaluation shall be ignored, system will log the // error only once since all rows the evaluation happens so inorder to avoid // too much log inforation only once the log will be printed. FilterUtil.logError(e, invalidRowsPresent); } } Collections.sort(filterValuesList, org.apache.carbondata.core.util.comparator.Comparator .getComparatorByDataTypeForMeasure(carbonMeasure.getDataType())); return filterValuesList; }
private List<byte[]> getNoDictionaryRangeValues() { List<ExpressionResult> listOfExpressionResults = new ArrayList<ExpressionResult>(20); if (this.getFilterExpression() instanceof BinaryConditionalExpression) { listOfExpressionResults = ((BinaryConditionalExpression) this.getFilterExpression()).getLiterals();