Skip to content

Commit 85b8aca

Browse files
committed
Don't touch Equals
1 parent cffb9cf commit 85b8aca

File tree

1 file changed

+7
-0
lines changed
  • x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/comparison

1 file changed

+7
-0
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/comparison/Equals.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.elasticsearch.xpack.esql.querydsl.query.SingleValueQuery;
2828

2929
import java.time.ZoneId;
30+
import java.util.Collection;
3031
import java.util.Map;
3132

3233
public class Equals extends EsqlBinaryComparison implements Negatable<EsqlBinaryComparison> {
@@ -139,6 +140,12 @@ public Equals(Source source, Expression left, Expression right, ZoneId zoneId) {
139140
@Override
140141
public Translatable translatable(LucenePushdownPredicates pushdownPredicates) {
141142
if (right() instanceof Literal lit) {
143+
// Multi-valued literals are not supported going further. This also makes sure that we are handling multi-valued literals with
144+
// a "warning" header, as well (see EqualsKeywordsEvaluator, for example, where lhs and rhs are both dealt with equally when
145+
// it comes to multi-value handling).
146+
if (lit.value() instanceof Collection<?>) {
147+
return Translatable.NO;
148+
}
142149
if (left().dataType() == DataType.TEXT && left() instanceof FieldAttribute fa) {
143150
if (pushdownPredicates.canUseEqualityOnSyntheticSourceDelegate(fa, ((BytesRef) lit.value()).utf8ToString())) {
144151
return Translatable.YES_BUT_RECHECK_NEGATED;

0 commit comments

Comments
 (0)