Skip to content

Commit f22d7e7

Browse files
Fix merge conflicts
1 parent bf677a5 commit f22d7e7

File tree

4 files changed

+649
-557
lines changed

4 files changed

+649
-557
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.elasticsearch.common.io.stream.StreamOutput;
1313
import org.elasticsearch.xpack.esql.core.expression.Expression;
1414
import org.elasticsearch.xpack.esql.core.expression.FieldAttribute;
15+
import org.elasticsearch.xpack.esql.core.expression.predicate.regex.RLikePattern;
1516
import org.elasticsearch.xpack.esql.core.expression.predicate.regex.RLikePatternList;
1617
import org.elasticsearch.xpack.esql.core.querydsl.query.AutomatonQuery;
1718
import org.elasticsearch.xpack.esql.core.querydsl.query.Query;
@@ -23,6 +24,7 @@
2324
import org.elasticsearch.xpack.esql.planner.TranslatorHandler;
2425

2526
import java.io.IOException;
27+
import java.util.stream.Collectors;
2628

2729
public class RLikeList extends RegexMatch<RLikePatternList> {
2830
public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry(
@@ -95,11 +97,17 @@ public Query asQuery(LucenePushdownPredicates pushdownPredicates, TranslatorHand
9597
}
9698

9799
private Query translateField(String targetFieldName) {
98-
return new AutomatonQuery(source(), targetFieldName, pattern().createAutomaton(caseInsensitive()));
100+
return new AutomatonQuery(source(), targetFieldName, pattern().createAutomaton(caseInsensitive()), getAutomatonDescription());
99101
}
100102

101103
@Override
102104
protected NodeInfo<? extends Expression> info() {
103105
return NodeInfo.create(this, RLikeList::new, field(), pattern(), caseInsensitive());
104106
}
107+
108+
private String getAutomatonDescription() {
109+
// we use the information used to create the automaton to describe the query here
110+
String patternDesc = pattern().patternList().stream().map(RLikePattern::pattern).collect(Collectors.joining("\", \""));
111+
return "LIKE(\"" + patternDesc + "\"), caseInsensitive=" + caseInsensitive();
112+
}
105113
}

0 commit comments

Comments
 (0)