Skip to content

Commit 49bb673

Browse files
committed
add verfications
1 parent 2bdb151 commit 49bb673

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public static Expression.TypeResolution resolve(
4444
if (resolution.unresolved()) {
4545
return resolution;
4646
}
47-
4847
try {
4948
Map<String, Object> optionsMap = new HashMap<>();
5049
populateMap((MapExpression) options, optionsMap, source, paramOrdinal, allowedOptions);

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/grouping/Categorize.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,14 @@ public Nullability nullable() {
166166

167167
@Override
168168
protected TypeResolution resolveType() {
169-
return isString(field(), sourceText(), DEFAULT).and(Options.resolve(options, source(), SECOND, ALLOWED_OPTIONS));
169+
return isString(field(), sourceText(), DEFAULT).and(Options.resolve(options, source(), SECOND, ALLOWED_OPTIONS)).and(() -> {
170+
try {
171+
categorizeDef();
172+
} catch (InvalidArgumentException e) {
173+
return new TypeResolution(e.getMessage());
174+
}
175+
return TypeResolution.TYPE_RESOLVED;
176+
});
170177
}
171178

172179
public CategorizeDef categorizeDef() {

0 commit comments

Comments
 (0)