Jackie-Jiang commented on a change in pull request #4216: PQL -> SQL enhancement - phase 1 - new Pinot Query Struct URL: https://github.com/apache/incubator-pinot/pull/4216#discussion_r291012295
########## File path: pinot-common/src/main/java/org/apache/pinot/pql/parsers/pql2/ast/InPredicateAstNode.java ########## @@ -108,7 +111,29 @@ public FilterQueryTree buildFilterQueryTree() { filterOperator = FilterOperator.IN; } - return new FilterQueryTree(_identifier, new ArrayList<>(values), filterOperator, null); + return new FilterQueryTree(_identifier, values, filterOperator, null); + } + + @Override + public Expression buildFilterExpression() { + if (_identifier == null) { + throw new Pql2CompilationException("IN predicate has no identifier"); + } + FilterKind filterOperator; + if (_isNotInClause) { + filterOperator = FilterKind.NOT_IN; + } else { + filterOperator = FilterKind.IN; + } + Expression expr = RequestUtils.getFunctionExpression(filterOperator.name()); + expr.getFunctionCall().addToOperands(RequestUtils.getIdentifierExpression(_identifier)); + for (AstNode astNode : getChildren()) { + if (astNode instanceof LiteralAstNode) { Review comment: Should we dedup here? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org