github-actions[bot] commented on code in PR #70369:
URL: https://github.com/apache/doris/pull/70369#discussion_r4561415333


##########
fe/fe-connector/fe-connector-es/src/main/java/org/apache/doris/connector/es/EsQueryDslBuilder.java:
##########
@@ -469,6 +469,12 @@ private static String comparisonToDsl(ConnectorComparison 
comparison,
             return null;
         }
         ConnectorLiteral literal = (ConnectorLiteral) valueExpr;
+        // An ARRAY literal compares whole arrays, but a term or range query 
matches any one value of a
+        // multi-valued field, so Doris evaluates the comparison itself.
+        if (literal.getValue() instanceof List) {

Review Comment:
   [P2] Reject ARRAY values in the other Elasticsearch literal readers
   
   For a native scalar keyword field `p` read through docvalues, this valid 
plan survives FE folding (BE folding is off by default):
   ```text
   Filter(p IN (CAST([TRUE] AS STRING), 'other'))
     ElasticsearchScan(p: STRING)
   ```
   ES allows cast pushdown, and the neutral converter strips `CastExpr`. This 
PR therefore hands `inToDsl` a `List<Boolean>` option; unlike 
`comparisonToDsl`, it does not reject it, and `extractLiteralValue` stringifies 
it as `"[true]"`. The previous ARRAY text and the actual BE cast both render 
`"[1]"`. ES now receives a terms query for `[true]`/`other`, drops matching 
`[1]` documents, and reports the conjunct pushed so Doris removes the residual 
and can also accept wrong `[true]` rows. `likeToDsl` has the same unguarded 
`String.valueOf` path.
   
   Apply the List rejection to IN/pattern readers too, or keep these casts 
local before conversion, and cover scalar cast constants. This is a separate ES 
predicate reader from the existing Hudi partition-pruning thread.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to