Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Jan 17, 2025
1 parent 482a349 commit 338ddfa
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 504 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,113 @@
*/
public class EsqlCapabilities {
public enum Cap {
/**
* Introduction of {@code MV_SORT}, {@code MV_SLICE}, and {@code MV_ZIP}.
* Added in #106095.
*/
MV_SORT,

/**
* When we disabled some broken optimizations around {@code nullable}.
* Fixed in #105691.
*/
DISABLE_NULLABLE_OPTS,

/**
* Introduction of {@code ST_X} and {@code ST_Y}. Added in #105768.
*/
ST_X_Y,

/**
* Changed precision of {@code geo_point} and {@code cartesian_point} fields, by loading from source into WKB. Done in #103691.
*/
SPATIAL_POINTS_FROM_SOURCE,

/**
* Support for loading {@code geo_shape} and {@code cartesian_shape} fields. Done in #104269.
*/
SPATIAL_SHAPES,

/**
* Support for spatial aggregation {@code ST_CENTROID}. Done in #104269.
*/
ST_CENTROID_AGG,

/**
* Support for spatial aggregation {@code ST_INTERSECTS}. Done in #104907.
*/
ST_INTERSECTS,

/**
* Support for spatial aggregation {@code ST_CONTAINS} and {@code ST_WITHIN}. Done in #106503.
*/
ST_CONTAINS_WITHIN,

/**
* Support for spatial aggregation {@code ST_DISJOINT}. Done in #107007.
*/
ST_DISJOINT,

/**
* The introduction of the {@code VALUES} agg.
*/
AGG_VALUES,

/**
* Does ESQL support async queries.
*/
ASYNC_QUERY,

/**
* Does ESQL support FROM OPTIONS?
*/
@Deprecated
FROM_OPTIONS,

/**
* Cast string literals to a desired data type.
*/
STRING_LITERAL_AUTO_CASTING,

/**
* Base64 encoding and decoding functions.
*/
BASE64_DECODE_ENCODE,

/**
* Support for the :: casting operator
*/
CASTING_OPERATOR,

/**
* Blocks can be labelled with {@link org.elasticsearch.compute.data.Block.MvOrdering#SORTED_ASCENDING} for optimizations.
*/
MV_ORDERING_SORTED_ASCENDING,

/**
* Support for metrics counter fields
*/
METRICS_COUNTER_FIELDS,

/**
* Cast string literals to a desired data type for IN predicate and more types for BinaryComparison.
*/
STRING_LITERAL_AUTO_CASTING_EXTENDED,

/**
* Support for metadata fields.
*/
METADATA_FIELDS,

/**
* Support for timespan units abbreviations
*/
TIMESPAN_ABBREVIATIONS,

/**
* Support metrics counter types
*/
COUNTER_TYPES,

/**
* Support for function {@code BIT_LENGTH}. Done in #115792
Expand Down Expand Up @@ -189,9 +296,12 @@ public enum Cap {
*/
ST_DISTANCE,

/** Support for function {@code ST_EXTENT}. */
/** Support for function {@code ST_EXTENT_AGG}. */
ST_EXTENT_AGG,

/** Optimization of ST_EXTENT_AGG with doc-values as IntBlock. */
ST_EXTENT_AGG_DOCVALUES,

/**
* Fix determination of CRS types in spatial functions when folding.
*/
Expand Down Expand Up @@ -380,6 +490,15 @@ public enum Cap {
*/
DATE_NANOS_AGGREGATIONS(),

/**
* Support the {@link org.elasticsearch.xpack.esql.expression.predicate.operator.comparison.In} operator for date nanos
*/
DATE_NANOS_IN_OPERATOR(),
/**
* Support running date format function on nanosecond dates
*/
DATE_NANOS_DATE_FORMAT(),

/**
* DATE_PARSE supports reading timezones
*/
Expand Down Expand Up @@ -564,7 +683,7 @@ public enum Cap {
/**
* LOOKUP JOIN
*/
JOIN_LOOKUP_V10(Build.current().isSnapshot()),
JOIN_LOOKUP_V11(Build.current().isSnapshot()),

/**
* Fix for https://github.com/elastic/elasticsearch/issues/117054
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.elasticsearch.xpack.esql.core.expression.Expression;
import org.elasticsearch.xpack.esql.core.expression.FieldAttribute;
import org.elasticsearch.xpack.esql.core.expression.FoldContext;
import org.elasticsearch.xpack.esql.core.expression.MapExpression;
import org.elasticsearch.xpack.esql.core.expression.TypeResolutions;
import org.elasticsearch.xpack.esql.core.planner.ExpressionTranslator;
import org.elasticsearch.xpack.esql.core.querydsl.query.QueryStringQuery;
Expand All @@ -34,7 +35,6 @@
import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
import org.elasticsearch.xpack.esql.expression.function.MapParam;
import org.elasticsearch.xpack.esql.expression.function.OptionalArgument;
import org.elasticsearch.xpack.esql.expression.function.OptionalArgument;
import org.elasticsearch.xpack.esql.expression.function.Param;
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
import org.elasticsearch.xpack.esql.io.stream.PlanStreamInput;
Expand Down Expand Up @@ -262,8 +262,8 @@ private Map<String, Object> parseOptions() throws InvalidArgumentException {
if (resolution.unresolved()) {
throw new InvalidArgumentException(resolution.message());
}
Object optionExprFold = optionExpr.fold();
Object valueExprFold = valueExpr.fold();
Object optionExprFold = optionExpr.fold(FoldContext.small());
Object valueExprFold = valueExpr.fold(FoldContext.small());
String optionName = optionExprFold instanceof BytesRef br ? br.utf8ToString() : optionExprFold.toString();
String optionValue = valueExprFold instanceof BytesRef br ? br.utf8ToString() : valueExprFold.toString();
// validate the optionExpr is supported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected List<TestCaseSupplier> cases() {

@Override
protected Expression build(Source source, List<Expression> args) {
return new Match(source, args.get(0), args.get(1));
return new Match(source, args.get(0), args.get(1), null);
}

@Override
Expand Down
Loading

0 comments on commit 338ddfa

Please sign in to comment.