Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
db5f8c5
WIP POC for expression join
julian-elastic Aug 21, 2025
d253a55
Change Parser to allow AND of expressions
julian-elastic Sep 3, 2025
b8f9ba6
Add more UTs and bugfixes
julian-elastic Sep 4, 2025
5cdb9c1
Address code review comments and bugfix
julian-elastic Sep 5, 2025
8703c28
Merge branch 'main' into expressionJoin_v4
julian-elastic Sep 5, 2025
0e02b5c
Fix compile error
julian-elastic Sep 5, 2025
f50d894
Address more code review comments
julian-elastic Sep 8, 2025
0ebaf9c
Address more code review comments
julian-elastic Sep 8, 2025
26358d6
Address code review comments part 3
julian-elastic Sep 9, 2025
188a870
Enhance UT coverage
julian-elastic Sep 9, 2025
537cdbf
Fix UTs
julian-elastic Sep 10, 2025
4716191
Grammar change
julian-elastic Sep 10, 2025
fb85f31
Address more feedback, refactoring
julian-elastic Sep 10, 2025
ea6f6b9
Remove matchFields from JoinConfig, HashJoinExec
alex-spies Sep 11, 2025
bc1a6ec
Revert JoinConfig back to Record
alex-spies Sep 11, 2025
31e8682
Stop using deprecated c'tor in test
alex-spies Sep 11, 2025
221d2d4
Fix some more tests
alex-spies Sep 11, 2025
f0ff7ce
Fix issue with matchFields refactor
julian-elastic Sep 11, 2025
8b75924
Merge branch 'main' into expressionJoin_v4
julian-elastic Sep 11, 2025
7354a2d
Address more code review comments
julian-elastic Sep 11, 2025
ed34ca4
Serialization changes for JoinConfig, comments
julian-elastic Sep 11, 2025
2046178
UT fixes
julian-elastic Sep 12, 2025
bef7514
UT fixes
julian-elastic Sep 12, 2025
64d105c
Change grammar, enforce capabilities
julian-elastic Sep 12, 2025
0e2fc54
Add test cases to HeapAttackIT.java
julian-elastic Sep 12, 2025
fe8c080
Parameterize LookupFromIndexOperatorTests
julian-elastic Sep 12, 2025
d849ff9
Add security tests
julian-elastic Sep 15, 2025
daa69e7
Bugfix
julian-elastic Sep 15, 2025
0de2092
Merge branch 'main' into expressionJoin_v4
julian-elastic Sep 16, 2025
d8076d2
Bugfix
julian-elastic Sep 16, 2025
b10c360
Address last code review comments
julian-elastic Sep 16, 2025
adb9290
Fix non-snapshot UT errors
julian-elastic Sep 16, 2025
99064c0
Merge branch 'main' into expressionJoin_v4
julian-elastic Sep 17, 2025
c3c27ff
Update docs/changelog/134098.yaml
julian-elastic Sep 17, 2025
142fcd9
Merge remote-tracking branch 'origin/expressionJoin_v4' into expressi…
julian-elastic Sep 17, 2025
9c4bf1f
More fixes for non-snapshot UT errors
julian-elastic Sep 17, 2025
bc48e62
Merge branch 'main' into expressionJoin_v4
julian-elastic Sep 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
| field from the left index | field from the lookup index |
| --- | --- |
| boolean | boolean |
| byte | half_float, float, double, scaled_float, byte, short, integer, long |
| byte | byte, short, integer, long, half_float, float, double, scaled_float |
| date | date |
| date_nanos | date_nanos |
| double | half_float, float, double, scaled_float, byte, short, integer, long |
| float | half_float, float, double, scaled_float, byte, short, integer, long |
| half_float | half_float, float, double, scaled_float, byte, short, integer, long |
| integer | half_float, float, double, scaled_float, byte, short, integer, long |
| integer | byte, short, integer, long, half_float, float, double, scaled_float |
| ip | ip |
| keyword | keyword |
| long | half_float, float, double, scaled_float, byte, short, integer, long |
| long | byte, short, integer, long, half_float, float, double, scaled_float |
| scaled_float | half_float, float, double, scaled_float, byte, short, integer, long |
| short | half_float, float, double, scaled_float, byte, short, integer, long |
| short | byte, short, integer, long, half_float, float, double, scaled_float |
| text | keyword |

Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ static TransportVersion def(int id) {
public static final TransportVersion INFERENCE_API_DISABLE_EIS_RATE_LIMITING = def(9_152_0_00);
public static final TransportVersion GEMINI_THINKING_BUDGET_ADDED = def(9_153_0_00);
public static final TransportVersion VISIT_PERCENTAGE = def(9_154_0_00);
public static final TransportVersion ESQL_LOOKUP_JOIN_ON_EXPRESSION = def(9_155_0_00);

/*
* STOP! READ THIS FIRST! No, really,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public final Query getQuery(int position) {
* Returns the query at the given position.
*/
@Nullable
abstract Query doGetQuery(int position, int firstValueIndex, int valueCount);
public abstract Query doGetQuery(int position, int firstValueIndex, int valueCount);

private Query wrapSingleValueQuery(Query query) {
assert onlySingleValueParams != null : "Requested to wrap single value query without single value params";
Expand Down Expand Up @@ -159,13 +159,8 @@ private Query wrapSingleValueQuery(Query query) {
* using only the {@link ElementType} of the {@link Block} to determine the
* query.
*/
public static QueryList rawTermQueryList(
MappedFieldType field,
SearchExecutionContext searchExecutionContext,
AliasFilter aliasFilter,
Block block
) {
IntFunction<Object> blockToJavaObject = switch (block.elementType()) {
public static IntFunction<Object> createBlockValueReader(Block block) {
return switch (block.elementType()) {
case BOOLEAN -> {
BooleanBlock booleanBlock = (BooleanBlock) block;
yield booleanBlock::getBoolean;
Expand Down Expand Up @@ -196,7 +191,20 @@ public static QueryList rawTermQueryList(
case AGGREGATE_METRIC_DOUBLE -> throw new IllegalArgumentException("can't read values from [aggregate metric double] block");
case UNKNOWN -> throw new IllegalArgumentException("can't read values from [" + block + "]");
};
return new TermQueryList(field, searchExecutionContext, aliasFilter, block, null, blockToJavaObject);
}

/**
* Returns a list of term queries for the given field and the input block
* using only the {@link ElementType} of the {@link Block} to determine the
* query.
*/
public static QueryList rawTermQueryList(
MappedFieldType field,
SearchExecutionContext searchExecutionContext,
AliasFilter aliasFilter,
Block block
) {
return new TermQueryList(field, searchExecutionContext, aliasFilter, block, null, createBlockValueReader(block));
}

/**
Expand Down Expand Up @@ -297,7 +305,7 @@ public TermQueryList onlySingleValues(Warnings warnings, String multiValueWarnin
}

@Override
Query doGetQuery(int position, int firstValueIndex, int valueCount) {
public Query doGetQuery(int position, int firstValueIndex, int valueCount) {
return switch (valueCount) {
case 0 -> null;
case 1 -> field.termQuery(blockValueReader.apply(firstValueIndex), searchExecutionContext);
Expand Down Expand Up @@ -360,7 +368,7 @@ public DateNanosQueryList onlySingleValues(Warnings warnings, String multiValueW
}

@Override
Query doGetQuery(int position, int firstValueIndex, int valueCount) {
public Query doGetQuery(int position, int firstValueIndex, int valueCount) {
return switch (valueCount) {
case 0 -> null;
case 1 -> dateFieldType.equalityQuery(blockValueReader.apply(firstValueIndex), searchExecutionContext);
Expand Down Expand Up @@ -412,7 +420,7 @@ public GeoShapeQueryList onlySingleValues(Warnings warnings, String multiValueWa
}

@Override
Query doGetQuery(int position, int firstValueIndex, int valueCount) {
public Query doGetQuery(int position, int firstValueIndex, int valueCount) {
return switch (valueCount) {
case 0 -> null;
case 1 -> shapeQuery.apply(firstValueIndex);
Expand Down Expand Up @@ -453,5 +461,5 @@ private IntFunction<Query> shapeQuery() {
}
}

protected record OnlySingleValueParams(Warnings warnings, String multiValueWarningMessage) {}
public record OnlySingleValueParams(Warnings warnings, String multiValueWarningMessage) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public MultiClusterSpecIT(
"LookupJoinOnTwoFieldsMultipleTimes",
// Lookup join after LIMIT is not supported in CCS yet
"LookupJoinAfterLimitAndRemoteEnrich",
"LookupJoinExpressionAfterLimitAndRemoteEnrich",
// Lookup join after FORK is not support in CCS yet
"ForkBeforeLookupJoin"
);
Expand Down
Loading