morrySnow commented on code in PR #39845:
URL: https://github.com/apache/doris/pull/39845#discussion_r1728781264


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/es/QueryBuilders.java:
##########
@@ -266,7 +267,21 @@ public static QueryBuilder toEsDsl(Expr expr, List<Expr> 
notPushDownList, Map<St
         // Replace col with col.keyword if mapping exist.
         column = fieldsContext.getOrDefault(column, column);
         if (expr instanceof BinaryPredicate) {
-            return parseBinaryPredicate(expr, opCode, column, needDateCompat);
+            BinaryPredicate binaryPredicate = (BinaryPredicate) expr;
+            Expr value;
+            if (binaryPredicate.slotIsLeft()) {
+                value = binaryPredicate.getChild(1);
+            } else {
+                value = binaryPredicate.getChild(0);
+            }
+            // only push down literal expr to ES
+            if (value instanceof LiteralExpr) {
+                LiteralExpr literalExpr = (LiteralExpr) value;
+                return parseBinaryPredicate(literalExpr, opCode, column, 
needDateCompat);

Review Comment:
   if binary predicate is literal vs slot, u should flip opCode



-- 
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-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to