Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES|QL: add MV_APPEND function #107001

Merged
merged 34 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
22055b8
Add mv_append function
luigidellaquila Feb 20, 2024
19e6de9
Fix tests
luigidellaquila Mar 14, 2024
f491c85
Merge branch 'main' into esql/mv_append_2
luigidellaquila Apr 2, 2024
a2ce9a0
Add tests
luigidellaquila Apr 2, 2024
b5e808b
Generate docs
luigidellaquila Apr 2, 2024
2be4d44
Better null testing
luigidellaquila Apr 2, 2024
b9133ef
Merge branch 'main' into esql/mv_append_2
luigidellaquila Apr 2, 2024
014384d
Merge branch 'main' into esql/mv_append_2
elasticmachine Apr 2, 2024
00b3101
Better nullability management + implement review suggestions
luigidellaquila Apr 3, 2024
d24af13
Merge remote-tracking branch 'luigidellaquila/esql/mv_append_2' into …
luigidellaquila Apr 3, 2024
19c8d8c
Merge branch 'main' into esql/mv_append_2
luigidellaquila Apr 3, 2024
b640bfc
Merge branch 'main' into esql/mv_append_2
luigidellaquila Apr 4, 2024
ffefab5
Merge branch 'main' into esql/mv_append_2
luigidellaquila Apr 11, 2024
479a376
Add CSV tests and Kibana docs
luigidellaquila Apr 11, 2024
38f4c43
Merge branch 'main' into esql/mv_append_2
luigidellaquila Apr 22, 2024
055fd53
More tests
luigidellaquila Apr 22, 2024
cad0cb4
Fix BWC
luigidellaquila Apr 22, 2024
372db2a
Merge branch 'main' into esql/mv_append_2
luigidellaquila May 2, 2024
b38d50e
Do not extend OptionalArgument
luigidellaquila May 2, 2024
434502b
Implement review suggestions
luigidellaquila May 15, 2024
51a159f
Make null inputs always return null
luigidellaquila May 15, 2024
bfff500
Spotless
luigidellaquila May 16, 2024
0331901
Add validation tests
luigidellaquila May 16, 2024
b111941
Merge branch 'main' into esql/mv_append_2
luigidellaquila May 16, 2024
f9b78d1
Fix tests and use capabilities
luigidellaquila May 16, 2024
1d6b9f2
Merge branch 'main' into esql/mv_append_2
luigidellaquila May 17, 2024
04c1ead
Spotless
luigidellaquila May 17, 2024
7275340
Merge branch 'main' into esql/mv_append_2
luigidellaquila May 24, 2024
7e101cf
Implement review suggestions
luigidellaquila May 24, 2024
d5312c3
Merge branch 'main' into esql/mv_append_2
luigidellaquila Jun 4, 2024
4dc127f
Fix conflicts
luigidellaquila Jun 4, 2024
a011137
Fix test
luigidellaquila Jun 4, 2024
ceb9297
Merge branch 'main' into esql/mv_append_2
elasticmachine Jun 4, 2024
a8f4d9f
Merge branch 'main' into esql/mv_append_2
elasticmachine Jun 4, 2024
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
5 changes: 5 additions & 0 deletions docs/reference/esql/functions/description/mv_append.asciidoc

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

242 changes: 242 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.

7 changes: 7 additions & 0 deletions docs/reference/esql/functions/kibana/docs/mv_append.md

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

14 changes: 14 additions & 0 deletions docs/reference/esql/functions/layout/mv_append.asciidoc

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

9 changes: 9 additions & 0 deletions docs/reference/esql/functions/parameters/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/signature/mv_append.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 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.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"keyword" : { "type" : "keyword" },
"date" : { "type" : "date" },
"date_nanos": { "type" : "date_nanos" },
"long" : { "type" : "long" },
"ip" : { "type" : "ip" },
"unsupported" : { "type" : "ip_range" },
"some" : {
"properties" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,23 @@ required_capability: agg_values
[1955-01-21T00:00:00Z, 1957-05-23T00:00:00Z, 1959-12-03T00:00:00Z] | null
;


mvAppendDates
required_capability: fn_mv_append

FROM employees
| WHERE emp_no == 10039 OR emp_no == 10040
| SORT emp_no
| EVAL dates = mv_append(birth_date, hire_date)
| KEEP emp_no, birth_date, hire_date, dates
;

emp_no:integer | birth_date:date | hire_date:date | dates:date
10039 | 1959-10-01T00:00:00Z | 1988-01-19T00:00:00Z | [1959-10-01T00:00:00Z, 1988-01-19T00:00:00Z]
10040 | null | 1993-02-14T00:00:00Z | null
;


implicitCastingNotEqual
required_capability: string_literal_auto_casting
from employees | where birth_date != "1957-05-23T00:00:00Z" | keep emp_no, birth_date | sort emp_no | limit 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,25 @@ required_capability: agg_values
[1.7, 1.83, 2.05] | null
;


mvAppend
required_capability: fn_mv_append

FROM employees
| WHERE emp_no == 10008 OR emp_no == 10021
| EVAL d = mv_append(salary_change, salary_change),
i = mv_append(salary_change.int, salary_change.int),
i2 = mv_append(emp_no, salary_change.int),
i3 = mv_append(emp_no, emp_no),
s = mv_append(salary_change.keyword, salary_change.keyword)
| KEEP emp_no, salary_change, d, i, i2, i3, s;

emp_no:integer | salary_change:double | d:double | i:integer | i2:integer | i3:integer | s:keyword
10008 | [-2.92,0.75,3.54,12.68] | [-2.92,0.75,3.54,12.68,-2.92,0.75,3.54,12.68] | [-2,0,3,12,-2,0,3,12] | [10008,-2,0,3,12] | [10008, 10008] | [-2.92,0.75,12.68,3.54,-2.92,0.75,12.68,3.54]
10021 | null | null | null | null | [10021, 10021] | null
;


signumOfPositiveDouble#[skip:-8.13.99,reason:new scalar function added in 8.14]
row d = to_double(100) | eval s = signum(d);

Expand Down
Loading