Skip to content

Commit 55595d6

Browse files
author
elasticsearchmachine
committed
Merge remote-tracking branch 'origin/main' into lucene_snapshot
2 parents d30c1f1 + fb70dd8 commit 55595d6

File tree

70 files changed

+8927
-2721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+8927
-2721
lines changed

docs/changelog/135744.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 135744
2+
summary: Non-Correlated Subquery in FROM command
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

docs/changelog/137024.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 137024
2+
summary: Catch-and-rethrow `TooComplexToDeterminizeException` within ESQL
3+
area: ES|QL
4+
type: bug
5+
issues: []

docs/reference/query-languages/query-dsl/full-text-filter-tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ GET /cooking_blog/_search
497497
"should": [
498498
{
499499
"term": {
500-
"category": "Main Course"
500+
"category.keyword": "Main Course"
501501
}
502502
},
503503
{

muted-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,9 @@ tests:
534534
- class: org.elasticsearch.cluster.routing.allocation.decider.WriteLoadConstraintDeciderIT
535535
method: testCanRemainNotPreferredIsIgnoredWhenAllOtherNodesReturnNotPreferred
536536
issue: https://github.com/elastic/elasticsearch/issues/137162
537+
- class: org.elasticsearch.xpack.esql.plan.logical.CommandLicenseTests
538+
method: testLicenseCheck
539+
issue: https://github.com/elastic/elasticsearch/issues/137168
537540

538541
# Examples:
539542
#

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/Attribute.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ public IdIgnoringWrapper ignoreId() {
7474
/**
7575
* Changing this will break bwc with 8.15, see {@link FieldAttribute#fieldName()}.
7676
*/
77-
protected static final String SYNTHETIC_ATTRIBUTE_NAME_PREFIX = "$$";
77+
public static final String SYNTHETIC_ATTRIBUTE_NAME_PREFIX = "$$";
78+
79+
public static final String SYNTHETIC_ATTRIBUTE_NAME_SEPARATOR = "$";
7880

7981
private static final TransportVersion ESQL_QUALIFIERS_IN_ATTRIBUTES = TransportVersion.fromName("esql_qualifiers_in_attributes");
8082

@@ -116,7 +118,7 @@ public Attribute(
116118
}
117119

118120
public static String rawTemporaryName(String... parts) {
119-
var name = String.join("$", parts);
121+
var name = String.join(SYNTHETIC_ATTRIBUTE_NAME_SEPARATOR, parts);
120122
return name.isEmpty() || name.startsWith(SYNTHETIC_ATTRIBUTE_NAME_PREFIX) ? name : SYNTHETIC_ATTRIBUTE_NAME_PREFIX + name;
121123
}
122124

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/predicate/regex/AbstractStringPattern.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,21 @@
1111
import org.apache.lucene.util.UnicodeUtil;
1212
import org.apache.lucene.util.automaton.Automaton;
1313
import org.apache.lucene.util.automaton.Operations;
14+
import org.apache.lucene.util.automaton.TooComplexToDeterminizeException;
1415

1516
public abstract class AbstractStringPattern implements StringPattern {
1617

1718
private Automaton automaton;
1819

19-
public abstract Automaton createAutomaton(boolean ignoreCase);
20+
public final Automaton createAutomaton(boolean ignoreCase) {
21+
try {
22+
return doCreateAutomaton(ignoreCase);
23+
} catch (TooComplexToDeterminizeException e) {
24+
throw new IllegalArgumentException("Pattern was too complex to determinize", e);
25+
}
26+
}
27+
28+
protected abstract Automaton doCreateAutomaton(boolean ignoreCase);
2029

2130
private Automaton automaton() {
2231
if (automaton == null) {

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/predicate/regex/RLikePattern.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void writeTo(StreamOutput out) throws IOException {
3434
}
3535

3636
@Override
37-
public Automaton createAutomaton(boolean ignoreCase) {
37+
protected Automaton doCreateAutomaton(boolean ignoreCase) {
3838
int matchFlags = ignoreCase ? RegExp.CASE_INSENSITIVE : 0;
3939
return Operations.determinize(
4040
new RegExp(regexpPattern, RegExp.ALL | RegExp.DEPRECATED_COMPLEMENT, matchFlags).toAutomaton(),

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/predicate/regex/RLikePatternList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public List<RLikePattern> patternList() {
4343
* We create a single automaton that is the union of all individual automatons to improve performance
4444
*/
4545
@Override
46-
public Automaton createAutomaton(boolean ignoreCase) {
46+
protected Automaton doCreateAutomaton(boolean ignoreCase) {
4747
List<Automaton> automatonList = patternList.stream().map(x -> x.createAutomaton(ignoreCase)).toList();
4848
Automaton result = Operations.union(automatonList);
4949
return Operations.determinize(result, Operations.DEFAULT_DETERMINIZE_WORK_LIMIT);

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/predicate/regex/WildcardPattern.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public String pattern() {
5353
}
5454

5555
@Override
56-
public Automaton createAutomaton(boolean ignoreCase) {
56+
protected Automaton doCreateAutomaton(boolean ignoreCase) {
5757
return ignoreCase
5858
? Operations.determinize(
5959
new RegExp(luceneWildcardToRegExp(wildcard), RegExp.ALL | RegExp.DEPRECATED_COMPLEMENT, RegExp.CASE_INSENSITIVE)

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/predicate/regex/WildcardPatternList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public List<WildcardPattern> patternList() {
5151
* We create a single automaton that is the union of all individual automata to improve performance
5252
*/
5353
@Override
54-
public Automaton createAutomaton(boolean ignoreCase) {
54+
protected Automaton doCreateAutomaton(boolean ignoreCase) {
5555
List<Automaton> automatonList = patternList.stream().map(x -> x.createAutomaton(ignoreCase)).toList();
5656
Automaton result = Operations.union(automatonList);
5757
return Operations.determinize(result, Operations.DEFAULT_DETERMINIZE_WORK_LIMIT);

0 commit comments

Comments
 (0)