Skip to content

Commit 2ee02a1

Browse files
bugfix
1 parent 018b40d commit 2ee02a1

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

docs/changelog/132889.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pr: 132889
22
summary: Improve Expanding Lookup Join performance by pushing a filter to the lookup
33
join
4-
area: "ES|QL, Performance"
4+
area: "ES|QL"
55
type: enhancement
6-
issues: []
6+
issues: [ ]

x-pack/plugin/esql/qa/testFixtures/src/main/resources/lookup-join.csv-spec

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5331,9 +5331,6 @@ lookupJoinWithExpressionOfOtherFields
53315331
| KEEP id_int, name_str, extra1, other1, other2
53325332
| SORT id_int, name_str, extra1, other1, other2
53335333
| LIMIT 20
5334-
/*
5335-
NEED TO DEBUG WHY THE FILTER IS NOT PUSHED TO THE RIGHT SIDE OF THE LOOKUP JOIN
5336-
*/
53375334
;
53385335

53395336
warning:Line 2:3: evaluation of [LOOKUP JOIN multi_column_joinable_lookup ON id_int, is_active_bool] failed, treating result as null. Only first 20 failures recorded.

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/ExpressionQueryList.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ private void buildPrePostJoinFilter(PhysicalPlan rightPreJoinPlan, ClusterServic
6464
);
6565
// If the pre-join filter is a FilterExec, we can convert it to a QueryBuilder
6666
// try to convert it to a QueryBuilder, if not possible apply it after the join
67-
if (filterExec instanceof TranslationAware translationAware) {
67+
if (filterExec.condition() instanceof TranslationAware translationAware
68+
&& TranslationAware.Translatable.YES.equals(translationAware.translatable(lucenePushdownPredicates))) {
6869
preJoinFilters.add(
6970
translationAware.asQuery(lucenePushdownPredicates, TRANSLATOR_HANDLER).toQueryBuilder().toQuery(context)
7071
);

0 commit comments

Comments
 (0)