You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/04/16 00:59:00 UTC

[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #8518: Support filtering on bool/scalar fields without evaluator

Jackie-Jiang commented on code in PR #8518:
URL: https://github.com/apache/pinot/pull/8518#discussion_r851566824


##########
pinot-common/src/main/java/org/apache/pinot/sql/parsers/rewriter/PredicateComparisonRewriter.java:
##########
@@ -18,21 +18,27 @@
  */
 package org.apache.pinot.sql.parsers.rewriter;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import org.apache.commons.lang3.EnumUtils;
 import org.apache.pinot.common.request.Expression;
+import org.apache.pinot.common.request.ExpressionType;
 import org.apache.pinot.common.request.Function;
 import org.apache.pinot.common.request.PinotQuery;
 import org.apache.pinot.common.utils.request.RequestUtils;
 import org.apache.pinot.pql.parsers.pql2.ast.FilterKind;
 import org.apache.pinot.sql.parsers.SqlCompilationException;
 
-
 public class PredicateComparisonRewriter implements QueryRewriter {
   @Override
   public PinotQuery rewrite(PinotQuery pinotQuery) {
     Expression filterExpression = pinotQuery.getFilterExpression();
     if (filterExpression != null) {
+      filterExpression = updateBooleanPredicates(filterExpression, null);

Review Comment:
   I'd do it within the `updateComparisonPredicate` (you may rename it to `updatePredicate`) so that it can be applied to both filter and having, and we just need to traverse the tree once



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org