Skip to content

Commit cffb9cf

Browse files
committed
Merge branch 'MVs_warnings_for_binary_comparisons' of https://github.com/astefan/elasticsearch into MVs_warnings_for_binary_comparisons
2 parents c079a22 + 4a3afd7 commit cffb9cf

File tree

2 files changed

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

2 files changed

+5
-7
lines changed

docs/changelog/137387.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 137387
2+
summary: Extends constant MVs handling with warnings to general binary comparisons
3+
area: ES|QL
4+
type: bug
5+
issues: []

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

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

2929
import java.time.ZoneId;
30-
import java.util.Collection;
3130
import java.util.Map;
3231

3332
public class Equals extends EsqlBinaryComparison implements Negatable<EsqlBinaryComparison> {
@@ -140,12 +139,6 @@ public Equals(Source source, Expression left, Expression right, ZoneId zoneId) {
140139
@Override
141140
public Translatable translatable(LucenePushdownPredicates pushdownPredicates) {
142141
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-
}
149142
if (left().dataType() == DataType.TEXT && left() instanceof FieldAttribute fa) {
150143
if (pushdownPredicates.canUseEqualityOnSyntheticSourceDelegate(fa, ((BytesRef) lit.value()).utf8ToString())) {
151144
return Translatable.YES_BUT_RECHECK_NEGATED;

0 commit comments

Comments
 (0)