morningman commented on code in PR #70369:
URL: https://github.com/apache/doris/pull/70369#discussion_r4574538099
##########
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:
Thanks, confirmed. Fixed in 3162b0e5eab once for every residual reader
rather than per builder: `buildRemainingFilter` now keeps a conjunct holding a
cast into or out of ARRAY, MAP or STRUCT (other than one between two types of
the same kind) in Doris whatever `supportsCastPredicatePushdown` returns, as it
already does for TIMESTAMPTZ casts. The converter strips the CAST, and the
operand of such a cast is not the value it yields (BE renders `[1]`, `["a"]`),
so no reader can push it faithfully. Elasticsearch `inToDsl`, `likeToDsl` and
REGEXP no longer see such a value, and neither does Paimon behind a Fluss union
read, which inherits the default `true` and stringifies VARCHAR values the same
way. A cast between two ARRAY types still reaches connectors, so
`arrays_overlap(col, [...])` and the JDBC / ES comparison checks are unchanged.
`PluginDrivenScanNodeCastPredicateTest` covers `=`, IN and LIKE on `CAST([true]
AS STRING)` and casts of ARRAY, MAP and STRUCT columns with casts acce
pted (each fails without the check), and keeps the ARRAY-to-ARRAY case pushed.
--
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]