Source:
private void init(List<String> arguments) throws SqlParseException { boolean predicatesSpecified = arguments.size() > 3; _thetaSketchColumn = arguments.get(0); _inputExpressions = new ArrayList<>(); _inputExpressions.add(TransformExpressionTree.compileToExpressionTree(_thetaSketchColumn)); String paramsString = arguments.get(1); _thetaSketchParams = ThetaSketchParams.fromString(paramsString); String postAggrExpressionString = arguments.get(arguments.size() - 1); _postAggregationExpression = CalciteSqlParser.compileToExpression(postAggrExpressionString); _predicateInfoSet = new LinkedHashSet<>(); _predicateStrings = new LinkedHashSet<>(arguments.subList(2, arguments.size() - 1)); _expressionMap = new HashMap<>(); if (predicatesSpecified) { for (String predicateString : _predicateStrings) { Expression expression = CalciteSqlParser.compileToExpression(predicateString); String filterColumn = ParserUtils.getFilterColumn(expression); Predicate predicate = Predicate.newPredicate(ParserUtils.getFilterType(expression), filterColumn, ParserUtils.getFilterValues(expression)); _predicateInfoSet.add(new PredicateInfo(predicateString, filterColumn, predicate)); _expressionMap.put(expression, predicateString); _inputExpressions.add(new TransformExpressionTree(new IdentifierAstNode(filterColumn))); } } else { Set<Expression> predicateExpressions = extractPredicatesFromString(postAggrExpressionString); for (Expression predicateExpression : predicateExpressions) { String filterColumn = ParserUtils.getFilterColumn(predicateExpression); Predicate predicate = Predicate .newPredicate(ParserUtils.getFilterType(predicateExpression), filterColumn, ParserUtils.getFilterValues(predicateExpression)); String predicateString = ParserUtils.standardizeExpression(predicateExpression, false); _predicateStrings.add(predicateString); _predicateInfoSet.add(new PredicateInfo(predicateString, filterColumn, predicate)); _expressionMap.put(predicateExpression, predicateString); _inputExpressions.add(new TransformExpressionTree(new IdentifierAstNode(filterColumn))); } } }

Target:
private void init(List<String> arguments) throws SqlParseException { int numArgs = arguments.size(); boolean predicatesSpecified = numArgs > 3; _thetaSketchColumn = arguments.get(0); _inputExpressions = new ArrayList<>(); _inputExpressions.add(TransformExpressionTree.compileToExpressionTree(_thetaSketchColumn)); String paramsString = arguments.get(1); _thetaSketchParams = ThetaSketchParams.fromString(paramsString); String postAggrExpressionString = arguments.get(numArgs - 1); _postAggregationExpression = CalciteSqlParser.compileToExpression(postAggrExpressionString); _predicateInfoSet = new LinkedHashSet<>(); _predicateStrings = new LinkedHashSet<>(arguments.subList(2, numArgs - 1)); _expressionMap = new HashMap<>(); if (predicatesSpecified) { for (String predicateString : _predicateStrings) { Expression expression = CalciteSqlParser.compileToExpression(predicateString); String filterColumn = ParserUtils.getFilterColumn(expression); Predicate predicate = Predicate .newPredicate(ParserUtils.getFilterType(expression), filterColumn, ParserUtils.getFilterValues(expression)); _predicateInfoSet.add(new PredicateInfo(predicateString, filterColumn, predicate)); _expressionMap.put(expression, predicateString); _inputExpressions.add(new TransformExpressionTree(new IdentifierAstNode(filterColumn))); } } else { Set<Expression> predicateExpressions = extractPredicatesFromString(postAggrExpressionString); for (Expression predicateExpression : predicateExpressions) { String filterColumn = ParserUtils.getFilterColumn(predicateExpression); Predicate predicate = Predicate.newPredicate(ParserUtils.getFilterType(predicateExpression), filterColumn, ParserUtils.getFilterValues(predicateExpression)); String predicateString = ParserUtils.standardizeExpression(predicateExpression, false); _predicateStrings.add(predicateString); _predicateInfoSet.add(new PredicateInfo(predicateString, filterColumn, predicate)); _expressionMap.put(predicateExpression, predicateString); _inputExpressions.add(new TransformExpressionTree(new IdentifierAstNode(filterColumn))); } } }