Skip to content

Commit 67b15ad

Browse files
Split ES|QL functions/operators/commands into separate pages for similar functions and make commands examples generated (#126279)
While the internal structure of the docs is already split into many (over 1000) sub-pages, the final display for the `Functions and Operators` page is a single giant page, making navigation harder. This PR splits it into separate pages, one for each group of similar functions and one for the operators. Twelve new pages. This PR also bundles a few other related changes. In total what is done is: * Split functions/operators into 12 pages, one for each group, maintaining the existing split of each function/operator into a snippet with dynamically generated examples * Split esql-commands.md into source-commands.md and processing-commands.md, each of which is split into individual snippets, one for each command * Each command snippet has it's examples split out into separate files, if they were examples that were dynamically generated in the older asciidoc system * The examples files are overwritten by the ES|QL unit tests, using a similar mechanism to the examples written for functions and operators) * Some additional refinements to the Kibana definition and markdown files (nicer operator headings, and display text)
1 parent f7c86b7 commit 67b15ad

File tree

356 files changed

+3234
-2860
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+3234
-2860
lines changed

docs/redirects.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
redirects:
2+
'reference/query-languages/esql/esql-functions-operators.md': '!reference/query-languages/esql/functions-operators/aggregation-functions.md'
3+
'reference/query-languages/esql/esql-commands.md': '!reference/query-languages/esql/commands/processing-commands.md'

docs/reference/query-languages/esql/_snippets/aggregation-functions.md

-53
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM sample_data
5+
| WHERE @timestamp > NOW() - 1 hour
6+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
ROW a = "2023-01-23T12:15:00.000Z - some text - 127.0.0.1"
5+
| DISSECT a """%{date} - %{msg} - %{ip}"""
6+
| KEEP date, msg, ip
7+
```
8+
9+
| date:keyword | msg:keyword | ip:keyword |
10+
| --- | --- | --- |
11+
| 2023-01-23T12:15:00.000Z | some text | 127.0.0.1 |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
ROW a = "2023-01-23T12:15:00.000Z 127.0.0.1 [email protected] 42"
5+
| GROK a """%{TIMESTAMP_ISO8601:date} %{IP:ip} %{EMAILADDRESS:email} %{NUMBER:num}"""
6+
| KEEP date, ip, email, num
7+
```
8+
9+
| date:keyword | ip:keyword | email:keyword | num:keyword |
10+
| --- | --- | --- | --- |
11+
| 2023-01-23T12:15:00.000Z | 127.0.0.1 | [email protected] | 42 |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
ROW a = "2023-01-23T12:15:00.000Z - some text - 127.0.0.1"
5+
| DISSECT a """%{date} - %{msg} - %{ip}"""
6+
| KEEP date, msg, ip
7+
| EVAL date = TO_DATETIME(date)
8+
```
9+
10+
| msg:keyword | ip:keyword | date:date |
11+
| --- | --- | --- |
12+
| some text | 127.0.0.1 | 2023-01-23T12:15:00.000Z |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
ROW a = "2023-01-23T12:15:00.000Z 127.0.0.1 [email protected] 42"
5+
| GROK a """%{TIMESTAMP_ISO8601:date} %{IP:ip} %{EMAILADDRESS:email} %{NUMBER:num:int}"""
6+
| KEEP date, ip, email, num
7+
```
8+
9+
| date:keyword | ip:keyword | email:keyword | num:integer |
10+
| --- | --- | --- | --- |
11+
| 2023-01-23T12:15:00.000Z | 127.0.0.1 | [email protected] | 42 |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM addresses
5+
| KEEP city.name, zip_code
6+
| GROK zip_code """%{WORD:zip_parts} %{WORD:zip_parts}"""
7+
```
8+
9+
| city.name:keyword | zip_code:keyword | zip_parts:keyword |
10+
| --- | --- | --- |
11+
| Amsterdam | 1016 ED | ["1016", "ED"] |
12+
| San Francisco | CA 94108 | ["CA", "94108"] |
13+
| Tokyo | 100-7014 | null |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
ROW a = "2023-01-23T12:15:00.000Z 127.0.0.1 [email protected] 42"
5+
| GROK a """%{TIMESTAMP_ISO8601:date} %{IP:ip} %{EMAILADDRESS:email} %{NUMBER:num:int}"""
6+
| KEEP date, ip, email, num
7+
| EVAL date = TO_DATETIME(date)
8+
```
9+
10+
| ip:keyword | email:keyword | num:integer | date:date |
11+
| --- | --- | --- | --- |
12+
| 127.0.0.1 | [email protected] | 42 | 2023-01-23T12:15:00.000Z |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP emp_no, first_name, last_name, height
6+
```
7+
8+
| emp_no:integer | first_name:keyword | last_name:keyword | height:double |
9+
| --- | --- | --- | --- |
10+
| 10001 | Georgi | Facello | 2.03 |
11+
| 10002 | Bezalel | Simmel | 2.08 |
12+
| 10003 | Parto | Bamford | 1.83 |
13+
| 10004 | Chirstian | Koblick | 1.78 |
14+
| 10005 | Kyoichi | Maliniak | 2.05 |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP first_name, last_name, first_name*
6+
```
7+
8+
| first_name:keyword | last_name:keyword |
9+
| --- | --- |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP h*, *
6+
```
7+
8+
| height:double | height.float:double | height.half_float:double | height.scaled_float:double | hire_date:date | avg_worked_seconds:long | birth_date:date | emp_no:integer | first_name:keyword | gender:keyword | is_rehired:boolean | job_positions:keyword | languages:integer | languages.byte:integer | languages.long:long | languages.short:integer | last_name:keyword | salary:integer | salary_change:double | salary_change.int:integer | salary_change.keyword:keyword | salary_change.long:long | still_hired:boolean |
9+
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP h*
6+
```
7+
8+
| height:double | height.float:double | height.half_float:double | height.scaled_float:double | hire_date:date |
9+
| --- | --- | --- | --- | --- |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP *, first_name
6+
```
7+
8+
| avg_worked_seconds:long | birth_date:date | emp_no:integer | gender:keyword | height:double | height.float:double | height.half_float:double | height.scaled_float:double | hire_date:date | is_rehired:boolean | job_positions:keyword | languages:integer | languages.byte:integer | languages.long:long | languages.short:integer | last_name:keyword | salary:integer | salary_change:double | salary_change.int:integer | salary_change.keyword:keyword | salary_change.long:long | still_hired:boolean | first_name:keyword |
9+
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP first_name*, last_name, first_na*
6+
```
7+
8+
| last_name:keyword | first_name:keyword |
9+
| --- | --- |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP first_name, last_name, still_hired
6+
| RENAME still_hired AS employed
7+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP first_name, last_name
6+
| RENAME first_name AS fn, last_name AS ln
7+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP first_name, last_name
6+
| RENAME first_name AS fn
7+
| RENAME last_name AS ln
8+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP first_name, last_name, height
6+
| SORT height
7+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP first_name, last_name, height
6+
| SORT height DESC
7+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP first_name, last_name, height
6+
| SORT first_name ASC NULLS FIRST
7+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP first_name, last_name, height
6+
| SORT height DESC, first_name ASC
7+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP first_name, last_name, still_hired
6+
| WHERE still_hired == true
7+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP first_name, last_name, still_hired
6+
| WHERE still_hired
7+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP first_name, last_name, height
6+
| WHERE LENGTH(first_name) < 4
7+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| DROP height
6+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| DROP height*
6+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
ROW language_code = "1"
5+
| ENRICH languages_policy
6+
```
7+
8+
| language_code:keyword | language_name:keyword |
9+
| --- | --- |
10+
| 1 | English |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
ROW a = "1"
5+
| ENRICH languages_policy ON a
6+
```
7+
8+
| a:keyword | language_name:keyword |
9+
| --- | --- |
10+
| 1 | English |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
ROW a = "1"
5+
| ENRICH languages_policy ON a WITH name = language_name
6+
```
7+
8+
| a:keyword | name:keyword |
9+
| --- | --- |
10+
| 1 | English |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
ROW a = "1"
5+
| ENRICH languages_policy ON a WITH language_name
6+
```
7+
8+
| a:keyword | language_name:keyword |
9+
| --- | --- |
10+
| 1 | English |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| SORT emp_no
6+
| KEEP first_name, last_name, height
7+
| EVAL height_feet = height * 3.281, height_cm = height * 100
8+
```
9+
10+
| first_name:keyword | last_name:keyword | height:double | height_feet:double | height_cm:double |
11+
| --- | --- | --- | --- | --- |
12+
| Georgi | Facello | 2.03 | 6.66043 | 202.99999999999997 |
13+
| Bezalel | Simmel | 2.08 | 6.82448 | 208.0 |
14+
| Parto | Bamford | 1.83 | 6.004230000000001 | 183.0 |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| SORT emp_no
6+
| KEEP first_name, last_name, height
7+
| EVAL height = height * 3.281
8+
```
9+
10+
| first_name:keyword | last_name:keyword | height:double |
11+
| --- | --- | --- |
12+
| Georgi | Facello | 6.66043 |
13+
| Bezalel | Simmel | 6.82448 |
14+
| Parto | Bamford | 6.004230000000001 |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| SORT emp_no
6+
| KEEP first_name, last_name, height
7+
| EVAL height * 3.281
8+
```
9+
10+
| first_name:keyword | last_name:keyword | height:double | height * 3.281:double |
11+
| --- | --- | --- | --- |
12+
| Georgi | Facello | 2.03 | 6.66043 |
13+
| Bezalel | Simmel | 2.08 | 6.82448 |
14+
| Parto | Bamford | 1.83 | 6.004230000000001 |

0 commit comments

Comments
 (0)