Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference/esql/functions/kibana/definition/like.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 72 additions & 0 deletions docs/reference/esql/functions/kibana/definition/mv_append.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions docs/reference/esql/functions/kibana/definition/mv_dedupe.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions docs/reference/esql/functions/kibana/definition/mv_slice.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/esql/functions/kibana/definition/rlike.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/esql/functions/types/like.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions docs/reference/esql/functions/types/mv_append.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/reference/esql/functions/types/mv_dedupe.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/reference/esql/functions/types/mv_slice.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/esql/functions/types/rlike.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ public class MvAppend extends EsqlScalarFunction implements EvaluatorMapper {
"cartesian_point",
"cartesian_shape",
"date",
"date_nanos",
"double",
"geo_point",
"geo_shape",
"integer",
"ip",
"keyword",
"long",
"unsigned_long",
"version" },
description = "Concatenates values of two multi-value fields."
)
Expand All @@ -74,6 +76,7 @@ public MvAppend(
"cartesian_point",
"cartesian_shape",
"date",
"date_nanos",
"double",
"geo_point",
"geo_shape",
Expand All @@ -82,6 +85,7 @@ public MvAppend(
"keyword",
"long",
"text",
"unsigned_long",
"version" }
) Expression field1,
@Param(
Expand All @@ -91,6 +95,7 @@ public MvAppend(
"cartesian_point",
"cartesian_shape",
"date",
"date_nanos",
"double",
"geo_point",
"geo_shape",
Expand All @@ -99,6 +104,7 @@ public MvAppend(
"keyword",
"long",
"text",
"unsigned_long",
"version" }
) Expression field2
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class MvDedupe extends AbstractMultivalueFunction {
"ip",
"keyword",
"long",
"unsigned_long",
"version" },
description = "Remove duplicate values from a multivalued field.",
note = "`MV_DEDUPE` may, but won't always, sort the values in the column.",
Expand All @@ -69,6 +70,7 @@ public MvDedupe(
"keyword",
"long",
"text",
"unsigned_long",
"version" },
description = "Multivalue expression."
) Expression field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class MvSlice extends EsqlScalarFunction implements OptionalArgument, Eva
"ip",
"keyword",
"long",
"unsigned_long",
"version" },
description = """
Returns a subset of the multivalued field using the start and end index values.
Expand Down Expand Up @@ -96,6 +97,7 @@ public MvSlice(
"keyword",
"long",
"text",
"unsigned_long",
"version" },
description = "Multivalue expression. If `null`, the function returns `null`."
) Expression field,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,9 @@ protected static TestCaseSupplier typeErrorSupplier(

/**
* Build a test case that asserts that the combination of parameter types is an error.
* @deprecated use an extension of {@link ErrorsForCasesWithoutExamplesTestCase}
*/
@Deprecated
protected static TestCaseSupplier typeErrorSupplier(
boolean includeOrdinal,
List<Set<DataType>> validPerPosition,
Expand Down Expand Up @@ -643,11 +645,17 @@ protected static void buildLayout(Layout.Builder builder, Expression e) {
protected Object toJavaObjectUnsignedLongAware(Block block, int position) {
Object result;
result = toJavaObject(block, position);
if (result != null && testCase.expectedType() == DataType.UNSIGNED_LONG) {
assertThat(result, instanceOf(Long.class));
result = NumericUtils.unsignedLongAsBigInteger((Long) result);
if (result == null || testCase.expectedType() != DataType.UNSIGNED_LONG) {
return result;
}
return result;
if (result instanceof List<?> l) {
return l.stream().map(v -> {
assertThat(v, instanceOf(Long.class));
return NumericUtils.unsignedLongAsBigInteger((Long) v);
}).toList();
}
assertThat(result, instanceOf(Long.class));
return NumericUtils.unsignedLongAsBigInteger((Long) result);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,11 @@ public void testFold() {
Object result = nullOptimized.fold(FoldContext.small());
// Decode unsigned longs into BigIntegers
if (testCase.expectedType() == DataType.UNSIGNED_LONG && result != null) {
result = NumericUtils.unsignedLongAsBigInteger((Long) result);
if (result instanceof List<?> l) {
result = l.stream().map(v -> NumericUtils.unsignedLongAsBigInteger((Long) v)).toList();
} else {
result = NumericUtils.unsignedLongAsBigInteger((Long) result);
}
}
assertThat(result, testCase.getMatcher());
if (testCase.getExpectedBuildEvaluatorWarnings() != null) {
Expand Down
Loading
Loading