Skip to content

Commit d1610e6

Browse files
Fix merge errors
1 parent fe3165d commit d1610e6

File tree

5 files changed

+11
-29
lines changed

5 files changed

+11
-29
lines changed

server/src/main/java/org/elasticsearch/TransportVersions.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ static TransportVersion def(int id) {
336336
public static final TransportVersion ESQL_LOCAL_RELATION_WITH_NEW_BLOCKS = def(9_117_0_00);
337337
public static final TransportVersion ESQL_FIXED_INDEX_LIKE = def(9_118_0_00);
338338

339-
340339
/*
341340
* STOP! READ THIS FIRST! No, really,
342341
* ____ _____ ___ ____ _ ____ _____ _ ____ _____ _ _ ___ ____ _____ ___ ____ ____ _____ _

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClustersIT.java

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848
import static org.hamcrest.Matchers.hasKey;
4949
import static org.hamcrest.Matchers.is;
5050
import static org.hamcrest.Matchers.nullValue;
51-
import static org.hamcrest.Matchers.is;
52-
import static org.hamcrest.Matchers.nullValue;
5351

5452
@ThreadLeakFilters(filters = TestClustersThreadFilter.class)
5553
public class MultiClustersIT extends ESRestTestCase {
@@ -297,7 +295,7 @@ private void assertClusterDetailsMap(Map<String, Object> result, boolean remoteO
297295
assertThat(
298296
remoteClusterShards,
299297
matchesMap().entry("total", greaterThanOrEqualTo(0))
300-
assertThat((Integer) remoteClusterShards.get("skipped"), greaterThanOrEqualTo(0));
298+
.entry("successful", remoteClusterShards.get("total"))
301299
.entry("skipped", greaterThanOrEqualTo(0))
302300
.entry("failed", 0)
303301
);
@@ -315,7 +313,7 @@ private void assertClusterDetailsMap(Map<String, Object> result, boolean remoteO
315313
assertThat(
316314
localClusterShards,
317315
matchesMap().entry("total", greaterThanOrEqualTo(0))
318-
assertThat((Integer) localClusterShards.get("skipped"), greaterThanOrEqualTo(0));
316+
.entry("successful", localClusterShards.get("total"))
319317
.entry("skipped", greaterThanOrEqualTo(0))
320318
.entry("failed", 0)
321319
);
@@ -432,6 +430,7 @@ public void testLikeIndex() throws Exception {
432430
assertResultMapForLike(includeCCSMetadata, result, columns, values, false, false);
433431
}
434432

433+
public void testLikeIndexLegacySettingNoResults() throws Exception {
435434
// the feature is completely supported if both local and remote clusters support it
436435
assumeTrue("not supported", capabilitiesSupportedNewAndOld(List.of("like_on_index_fields")));
437436
try (
@@ -551,28 +550,6 @@ public void testRLikeIndex() throws Exception {
551550
assertResultMapForLike(includeCCSMetadata, result, columns, values, false, false);
552551
}
553552

554-
public void testNotRLikeIndex() throws Exception {
555-
boolean includeCCSMetadata = includeCCSMetadata();
556-
Map<String, Object> result = run("""
557-
FROM test-local-index,*:test-remote-index METADATA _index
558-
| WHERE _index NOT RLIKE ".*remote.*"
559-
| STATS c = COUNT(*) BY _index
560-
| SORT _index ASC
561-
""", includeCCSMetadata);
562-
var columns = List.of(Map.of("name", "c", "type", "long"), Map.of("name", "_index", "type", "keyword"));
563-
var values = List.of(List.of(localDocs.size(), localIndex));
564-
assertResultMapForLike(includeCCSMetadata, result, columns, values, false, false);
565-
Map<String, Object> result = run("""
566-
FROM test-local-index,*:test-remote-index METADATA _index
567-
| WHERE _index RLIKE ".*remote.*"
568-
| STATS c = COUNT(*) BY _index
569-
| SORT _index ASC
570-
""", includeCCSMetadata);
571-
var columns = List.of(Map.of("name", "c", "type", "long"), Map.of("name", "_index", "type", "keyword"));
572-
var values = List.of(List.of(remoteDocs.size(), REMOTE_CLUSTER_NAME + ":" + remoteIndex));
573-
assertResultMapForLike(includeCCSMetadata, result, columns, values, false, false);
574-
}
575-
576553
public void testNotRLikeIndex() throws Exception {
577554
boolean includeCCSMetadata = includeCCSMetadata();
578555
Map<String, Object> result = run("""

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/regex/WildcardLike.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ public Query asQuery(LucenePushdownPredicates pushdownPredicates, TranslatorHand
130130

131131
// TODO: see whether escaping is needed
132132
private Query translateField(String targetFieldName, boolean forceStringMatch) {
133-
boolean forceStringMatch = configuration != null && configuration.stringLikeOnIndex();
134133
return new WildcardQuery(source(), targetFieldName, pattern().asLuceneWildcard(), caseInsensitive(), forceStringMatch);
135134
}
136135
}

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/regex/WildcardLikeList.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.apache.lucene.search.MultiTermQuery.RewriteMethod;
1111
import org.apache.lucene.util.automaton.Automaton;
1212
import org.apache.lucene.util.automaton.CharacterRunAutomaton;
13+
import org.elasticsearch.TransportVersion;
1314
import org.elasticsearch.TransportVersions;
1415
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
1516
import org.elasticsearch.common.io.stream.StreamInput;

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalPhysicalPlanOptimizerTests.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
import org.elasticsearch.xpack.esql.plan.physical.TimeSeriesSourceExec;
9595
import org.elasticsearch.xpack.esql.plan.physical.TopNExec;
9696
import org.elasticsearch.xpack.esql.planner.FilterTests;
97+
import org.elasticsearch.xpack.esql.plugin.EsqlFlags;
9798
import org.elasticsearch.xpack.esql.plugin.QueryPragmas;
9899
import org.elasticsearch.xpack.esql.querydsl.query.SingleValueQuery;
99100
import org.elasticsearch.xpack.esql.rule.Rule;
@@ -2083,7 +2084,12 @@ public void testVerifierOnMissingReferences() throws Exception {
20832084
// We want to verify that the localOptimize detects the missing attribute.
20842085
// However, it also throws an error in one of the rules before we get to the verifier.
20852086
// So we use an implementation of LocalPhysicalPlanOptimizer that does not have any rules.
2086-
LocalPhysicalOptimizerContext context = new LocalPhysicalOptimizerContext(config, FoldContext.small(), SearchStats.EMPTY);
2087+
LocalPhysicalOptimizerContext context = new LocalPhysicalOptimizerContext(
2088+
new EsqlFlags(true),
2089+
config,
2090+
FoldContext.small(),
2091+
SearchStats.EMPTY
2092+
);
20872093
LocalPhysicalPlanOptimizer optimizerWithNoopExecute = new LocalPhysicalPlanOptimizer(context) {
20882094
@Override
20892095
protected List<Batch<PhysicalPlan>> batches() {

0 commit comments

Comments
 (0)