Skip to content

Commit 44cfa85

Browse files
committed
Merge branch '118621_fix' of https://github.com/astefan/elasticsearch into 118621_fix
2 parents 03c348d + 4dbf1b3 commit 44cfa85

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/DataLoader.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,11 @@ public static void loadDatasetIntoEs(RestClient client, CheckedBiFunction<XConte
9898
});
9999
}
100100

101-
private static void loadDatasetIntoEsWithIndexCreator(RestClient client, CheckedBiFunction<XContent, InputStream, XContentParser, IOException> p, IndexCreator indexCreator)
102-
throws IOException {
101+
private static void loadDatasetIntoEsWithIndexCreator(
102+
RestClient client,
103+
CheckedBiFunction<XContent, InputStream, XContentParser, IOException> p,
104+
IndexCreator indexCreator
105+
) throws IOException {
103106

104107
//
105108
// Main Index

x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/optimizer/OptimizerRules.java

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,31 +1256,29 @@ protected Expression rule(Or or) {
12561256
if (found.isEmpty() == false) {
12571257
// combine Equals alongside the existing ORs
12581258
final ZoneId finalZoneId = zoneId;
1259-
found.forEach(
1260-
(k, v) -> {
1261-
if (v.size() == 1) {
1262-
ors.add(createEquals(k, v.iterator().next(), finalZoneId));
1263-
} else {
1264-
In in = createIn(k, new ArrayList<>(v), finalZoneId);
1265-
// IN has its own particularities when it comes to type resolution and not all implementations
1266-
// double check the validity of an internally created IN (like the one created here). EQL is one where the IN
1267-
// implementation is like this mechanism here has been specifically created for it
1268-
if (shouldValidateIn()) {
1269-
Expression.TypeResolution resolution = in.validateInTypes();
1270-
if (resolution.unresolved()) {
1271-
// if the internally created In is not valid, fall back to the original ORs
1272-
assert originalOrs.containsKey(k);
1273-
assert originalOrs.get(k).isEmpty() == false;
1274-
ors.add(combineOr(originalOrs.get(k)));
1275-
} else {
1276-
ors.add(in);
1277-
}
1259+
found.forEach((k, v) -> {
1260+
if (v.size() == 1) {
1261+
ors.add(createEquals(k, v.iterator().next(), finalZoneId));
1262+
} else {
1263+
In in = createIn(k, new ArrayList<>(v), finalZoneId);
1264+
// IN has its own particularities when it comes to type resolution and not all implementations
1265+
// double check the validity of an internally created IN (like the one created here). EQL is one where the IN
1266+
// implementation is like this mechanism here has been specifically created for it
1267+
if (shouldValidateIn()) {
1268+
Expression.TypeResolution resolution = in.validateInTypes();
1269+
if (resolution.unresolved()) {
1270+
// if the internally created In is not valid, fall back to the original ORs
1271+
assert originalOrs.containsKey(k);
1272+
assert originalOrs.get(k).isEmpty() == false;
1273+
ors.add(combineOr(originalOrs.get(k)));
12781274
} else {
12791275
ors.add(in);
12801276
}
1277+
} else {
1278+
ors.add(in);
12811279
}
12821280
}
1283-
);
1281+
});
12841282

12851283
Expression combineOr = combineOr(ors);
12861284
// check the result semantically since the result might different in order

0 commit comments

Comments
 (0)