Skip to content

Commit 338ddfa

Browse files
committed
Fix merge
1 parent 482a349 commit 338ddfa

File tree

4 files changed

+125
-504
lines changed

4 files changed

+125
-504
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 121 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,113 @@
2727
*/
2828
public class EsqlCapabilities {
2929
public enum Cap {
30+
/**
31+
* Introduction of {@code MV_SORT}, {@code MV_SLICE}, and {@code MV_ZIP}.
32+
* Added in #106095.
33+
*/
34+
MV_SORT,
35+
36+
/**
37+
* When we disabled some broken optimizations around {@code nullable}.
38+
* Fixed in #105691.
39+
*/
40+
DISABLE_NULLABLE_OPTS,
41+
42+
/**
43+
* Introduction of {@code ST_X} and {@code ST_Y}. Added in #105768.
44+
*/
45+
ST_X_Y,
46+
47+
/**
48+
* Changed precision of {@code geo_point} and {@code cartesian_point} fields, by loading from source into WKB. Done in #103691.
49+
*/
50+
SPATIAL_POINTS_FROM_SOURCE,
51+
52+
/**
53+
* Support for loading {@code geo_shape} and {@code cartesian_shape} fields. Done in #104269.
54+
*/
55+
SPATIAL_SHAPES,
56+
57+
/**
58+
* Support for spatial aggregation {@code ST_CENTROID}. Done in #104269.
59+
*/
60+
ST_CENTROID_AGG,
61+
62+
/**
63+
* Support for spatial aggregation {@code ST_INTERSECTS}. Done in #104907.
64+
*/
65+
ST_INTERSECTS,
66+
67+
/**
68+
* Support for spatial aggregation {@code ST_CONTAINS} and {@code ST_WITHIN}. Done in #106503.
69+
*/
70+
ST_CONTAINS_WITHIN,
71+
72+
/**
73+
* Support for spatial aggregation {@code ST_DISJOINT}. Done in #107007.
74+
*/
75+
ST_DISJOINT,
76+
77+
/**
78+
* The introduction of the {@code VALUES} agg.
79+
*/
80+
AGG_VALUES,
81+
82+
/**
83+
* Does ESQL support async queries.
84+
*/
85+
ASYNC_QUERY,
86+
87+
/**
88+
* Does ESQL support FROM OPTIONS?
89+
*/
90+
@Deprecated
91+
FROM_OPTIONS,
92+
93+
/**
94+
* Cast string literals to a desired data type.
95+
*/
96+
STRING_LITERAL_AUTO_CASTING,
97+
98+
/**
99+
* Base64 encoding and decoding functions.
100+
*/
101+
BASE64_DECODE_ENCODE,
102+
103+
/**
104+
* Support for the :: casting operator
105+
*/
106+
CASTING_OPERATOR,
107+
108+
/**
109+
* Blocks can be labelled with {@link org.elasticsearch.compute.data.Block.MvOrdering#SORTED_ASCENDING} for optimizations.
110+
*/
111+
MV_ORDERING_SORTED_ASCENDING,
112+
113+
/**
114+
* Support for metrics counter fields
115+
*/
116+
METRICS_COUNTER_FIELDS,
117+
118+
/**
119+
* Cast string literals to a desired data type for IN predicate and more types for BinaryComparison.
120+
*/
121+
STRING_LITERAL_AUTO_CASTING_EXTENDED,
122+
123+
/**
124+
* Support for metadata fields.
125+
*/
126+
METADATA_FIELDS,
127+
128+
/**
129+
* Support for timespan units abbreviations
130+
*/
131+
TIMESPAN_ABBREVIATIONS,
132+
133+
/**
134+
* Support metrics counter types
135+
*/
136+
COUNTER_TYPES,
30137

31138
/**
32139
* Support for function {@code BIT_LENGTH}. Done in #115792
@@ -189,9 +296,12 @@ public enum Cap {
189296
*/
190297
ST_DISTANCE,
191298

192-
/** Support for function {@code ST_EXTENT}. */
299+
/** Support for function {@code ST_EXTENT_AGG}. */
193300
ST_EXTENT_AGG,
194301

302+
/** Optimization of ST_EXTENT_AGG with doc-values as IntBlock. */
303+
ST_EXTENT_AGG_DOCVALUES,
304+
195305
/**
196306
* Fix determination of CRS types in spatial functions when folding.
197307
*/
@@ -380,6 +490,15 @@ public enum Cap {
380490
*/
381491
DATE_NANOS_AGGREGATIONS(),
382492

493+
/**
494+
* Support the {@link org.elasticsearch.xpack.esql.expression.predicate.operator.comparison.In} operator for date nanos
495+
*/
496+
DATE_NANOS_IN_OPERATOR(),
497+
/**
498+
* Support running date format function on nanosecond dates
499+
*/
500+
DATE_NANOS_DATE_FORMAT(),
501+
383502
/**
384503
* DATE_PARSE supports reading timezones
385504
*/
@@ -564,7 +683,7 @@ public enum Cap {
564683
/**
565684
* LOOKUP JOIN
566685
*/
567-
JOIN_LOOKUP_V10(Build.current().isSnapshot()),
686+
JOIN_LOOKUP_V11(Build.current().isSnapshot()),
568687

569688
/**
570689
* Fix for https://github.com/elastic/elasticsearch/issues/117054

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/fulltext/Match.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.elasticsearch.xpack.esql.core.expression.Expression;
2323
import org.elasticsearch.xpack.esql.core.expression.FieldAttribute;
2424
import org.elasticsearch.xpack.esql.core.expression.FoldContext;
25+
import org.elasticsearch.xpack.esql.core.expression.MapExpression;
2526
import org.elasticsearch.xpack.esql.core.expression.TypeResolutions;
2627
import org.elasticsearch.xpack.esql.core.planner.ExpressionTranslator;
2728
import org.elasticsearch.xpack.esql.core.querydsl.query.QueryStringQuery;
@@ -34,7 +35,6 @@
3435
import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
3536
import org.elasticsearch.xpack.esql.expression.function.MapParam;
3637
import org.elasticsearch.xpack.esql.expression.function.OptionalArgument;
37-
import org.elasticsearch.xpack.esql.expression.function.OptionalArgument;
3838
import org.elasticsearch.xpack.esql.expression.function.Param;
3939
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
4040
import org.elasticsearch.xpack.esql.io.stream.PlanStreamInput;
@@ -262,8 +262,8 @@ private Map<String, Object> parseOptions() throws InvalidArgumentException {
262262
if (resolution.unresolved()) {
263263
throw new InvalidArgumentException(resolution.message());
264264
}
265-
Object optionExprFold = optionExpr.fold();
266-
Object valueExprFold = valueExpr.fold();
265+
Object optionExprFold = optionExpr.fold(FoldContext.small());
266+
Object valueExprFold = valueExpr.fold(FoldContext.small());
267267
String optionName = optionExprFold instanceof BytesRef br ? br.utf8ToString() : optionExprFold.toString();
268268
String optionValue = valueExprFold instanceof BytesRef br ? br.utf8ToString() : valueExprFold.toString();
269269
// validate the optionExpr is supported

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchErrorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected List<TestCaseSupplier> cases() {
3131

3232
@Override
3333
protected Expression build(Source source, List<Expression> args) {
34-
return new Match(source, args.get(0), args.get(1));
34+
return new Match(source, args.get(0), args.get(1), null);
3535
}
3636

3737
@Override

0 commit comments

Comments
 (0)