Abdon Pijpelink 2 年 前
コミット
518a97006a

+ 11 - 10
docs/reference/esql/esql-functions.asciidoc

@@ -1,9 +1,18 @@
 [[esql-functions]]
 == ESQL functions
 
-<<esql-eval,`EVAL`>> and <<esql-where,`WHERE`>> support the following functions:
+<<esql-eval,`EVAL`>> and <<esql-where,`WHERE`>> support these functions:
+
+* <<esql-abs>>
+* <<esql-concat>>
+* <<esql-date_format>>
+* <<esql-date_trunc>>
+* <<esql-is_null>>
+* <<esql-length>>
+* <<esql-round>>
+* <<esql-starts_with>>
+* <<esql-substring>>
 
-[discrete]
 [[esql-abs]]
 === `ABS`
 Returns the absolute value.
@@ -15,7 +24,6 @@ FROM employees
 | EVAL abs_height = ABS(0.0 - height)
 ----
 
-[discrete]
 [[esql-concat]]
 === `CONCAT`
 Concatenates two or more strings.
@@ -27,7 +35,6 @@ FROM employees
 | EVAL fullname = CONCAT(first_name, " ", last_name)
 ----
 
-[discrete]
 [[esql-date_format]]
 === `DATE_FORMAT`
 Returns a string representation of a date in the provided format. If no format
@@ -40,7 +47,6 @@ FROM employees
 | EVAL hired = DATE_FORMAT(hire_date, "YYYY-MM-dd")
 ----
 
-[discrete]
 [[esql-date_trunc]]
 === `DATE_TRUNC`
 Rounds down a date to the closest interval. Intervals can be expressed using the
@@ -54,7 +60,6 @@ FROM employees
 | SORT year_hired
 ----
 
-[discrete]
 [[esql-is_null]]
 === `IS_NULL`
 Returns a boolean than indicates whether its input is `null`.  
@@ -73,7 +78,6 @@ FROM employees
 | WHERE NOT is_null(first_name)
 ----
 
-[discrete]
 [[esql-length]]
 === `LENGTH`
 Returns the character length of a string.
@@ -85,7 +89,6 @@ FROM employees
 | EVAL fn_length = LENGTH(first_name)
 ----
 
-[discrete]
 [[esql-round]]
 === `ROUND`
 Rounds a number to the closest number with the specified number of digits.
@@ -99,7 +102,6 @@ FROM employees
 | EVAL height = ROUND(height * 3.281, 1)
 ----
 
-[discrete]
 [[esql-starts_with]]
 === `STARTS_WITH`
 Returns a boolean that indicates whether a keyword string starts with another 
@@ -112,7 +114,6 @@ FROM employees
 | EVAL ln_S = STARTS_WITH(last_name, "S")
 ----
 
-[discrete]
 [[esql-substring]]
 === `SUBSTRING`
 Returns a substring of a string, specified by a start position and an optional

+ 108 - 80
docs/reference/esql/esql-processing-commands.asciidoc

@@ -6,7 +6,61 @@ and columns.
 
 image::images/esql/processing-command.svg[A processing command changes an input table,align="center"]
 
+ESQL supports these processing commands:
+
+* <<esql-dissect>>
+* <<esql-drop>>
+* <<esql-eval>>
+* <<esql-grok>>
+* <<esql-limit>>
+* <<esql-project>>
+* <<esql-rename>>
+* <<esql-sort>>
+* <<esql-stats-by>>
+* <<esql-where>>
+
+
+[[esql-dissect]]
+=== `DISSECT`
+
+TODO
+
+[[esql-drop]]
+=== `DROP`
+
+TODO
+
+[[esql-eval]]
+=== `EVAL`
+`EVAL` enables you to add new columns to the end of the table:
+
+[source,esql]
+----
+FROM employees
+| PROJECT first_name, last_name, height
+| EVAL height_feet = height * 3.281, height_cm = height * 100
+----
+
+If the specified column already exists, the existing column will be dropped, and
+the new column will be appended to the table:
+
+[source,esql]
+----
+FROM employees
+| PROJECT first_name, last_name, height
+| EVAL height = height * 3.281
+----
+
 [discrete]
+==== Functions 
+`EVAL` supports various functions for calculating values. Refer to
+<<esql-functions,Functions>> for more information.
+
+[[esql-grok]]
+=== `GROK`
+
+TODO
+
 [[esql-limit]]
 === `LIMIT`
 
@@ -18,7 +72,6 @@ FROM employees
 | LIMIT 5
 ----
 
-[discrete]
 [[esql-project]]
 === `PROJECT`
 
@@ -72,34 +125,11 @@ FROM employees
 | PROJECT current_employee = still_hired, *
 ----
 
-[discrete]
-[[esql-eval]]
-=== `EVAL`
-`EVAL` enables you to add new columns to the end of the table:
-
-[source,esql]
-----
-FROM employees
-| PROJECT first_name, last_name, height
-| EVAL height_feet = height * 3.281, height_cm = height * 100
-----
-
-If the specified column already exists, the existing column will be dropped, and
-the new column will be appended to the table:
+[[esql-rename]]
+=== `RENAME`
 
-[source,esql]
-----
-FROM employees
-| PROJECT first_name, last_name, height
-| EVAL height = height * 3.281
-----
-
-[discrete]
-==== Functions 
-`EVAL` supports various functions for calculating values. Refer to
-<<esql-functions,Functions>> for more information.
+TODO
 
-[discrete]
 [[esql-sort]]
 === `SORT`
 Use the `SORT` command to sort rows on one or more fields:
@@ -145,7 +175,56 @@ FROM employees
 | SORT first_name ASC NULLS FIRST
 ----
 
-[discrete]
+[[esql-stats-by]]
+=== `STATS ... BY`
+Use `STATS ... BY` to group rows according to a common value and calculate one
+or more aggregated values over the grouped rows. 
+
+[source,esql]
+----
+FROM employees
+| STATS count = COUNT(languages) BY languages
+----
+
+If `BY` is omitted, the output table contains exactly one row with the
+aggregations applied over the entire dataset:
+
+[source,esql]
+----
+FROM employees
+| STATS avg_lang = AVG(languages)
+----
+
+It's possible to calculate multiple values:
+
+[source,esql]
+----
+FROM employees
+| STATS avg_lang = AVG(languages), max_lang = MAX(languages)
+----
+
+It's also possible to group by multiple values (only supported for long and
+keyword family fields):
+
+[source,esql]
+----
+FROM employees
+| EVAL hired = DATE_FORMAT(hire_date, "YYYY")
+| STATS avg_salary = AVG(salary) BY hired, languages.long
+| EVAL avg_salary = ROUND(avg_salary)
+| SORT hired, languages.long
+----
+
+The following aggregation functions are supported:
+
+* `AVG`
+* `COUNT`
+* `MAX`
+* `MEDIAN`
+* `MEDIAN_ABSOLUTE_DEVIATION`
+* `MIN`
+* `SUM`
+
 [[esql-where]]
 === `WHERE`
 
@@ -203,55 +282,4 @@ FROM employees
 FROM employees
 | PROJECT first_name, last_name, height
 | WHERE length(first_name) < 4
-----
-
-[discrete]
-[[esql-stats-by]]
-=== `STATS ... BY`
-Use `STATS ... BY` to group rows according to a common value and calculate one
-or more aggregated values over the grouped rows. 
-
-[source,esql]
-----
-FROM employees
-| STATS count = COUNT(languages) BY languages
-----
-
-If `BY` is omitted, the output table contains exactly one row with the
-aggregations applied over the entire dataset:
-
-[source,esql]
-----
-FROM employees
-| STATS avg_lang = AVG(languages)
-----
-
-It's possible to calculate multiple values:
-
-[source,esql]
-----
-FROM employees
-| STATS avg_lang = AVG(languages), max_lang = MAX(languages)
-----
-
-It's also possible to group by multiple values (only supported for long and
-keyword family fields):
-
-[source,esql]
-----
-FROM employees
-| EVAL hired = DATE_FORMAT(hire_date, "YYYY")
-| STATS avg_salary = AVG(salary) BY hired, languages.long
-| EVAL avg_salary = ROUND(avg_salary)
-| SORT hired, languages.long
-----
-
-The following aggregation functions are supported:
-
-* `AVG`
-* `COUNT`
-* `MAX`
-* `MEDIAN`
-* `MEDIAN_ABSOLUTE_DEVIATION`
-* `MIN`
-* `SUM`
+----