From eb88b8953de4296e13423cf6d0f7d173b30a178e Mon Sep 17 00:00:00 2001 From: Craig Taverner Date: Mon, 31 Mar 2025 20:53:02 +0200 Subject: [PATCH 1/2] Kibana updates, remove links from JSON and split is-null/is-not-null --- .../operators/examples/is_not_null.md | 15 ++ .../_snippets/operators/examples/is_null.md | 19 ++ .../_snippets/operators/types/is_not_null.md | 22 ++ .../esql/_snippets/operators/types/is_null.md | 22 ++ .../esql/images/operators/is_not_null.svg | 1 + .../esql/images/operators/is_null.svg | 1 + .../kibana/definition/functions/greatest.json | 2 +- .../kibana/definition/functions/least.json | 2 +- .../kibana/definition/functions/match.json | 2 +- .../kibana/definition/functions/median.json | 4 +- .../functions/median_absolute_deviation.json | 2 +- .../kibana/definition/functions/mv_first.json | 2 +- .../kibana/definition/functions/mv_last.json | 2 +- .../kibana/definition/functions/mv_slice.json | 2 +- .../kibana/definition/functions/qstr.json | 2 +- .../definition/functions/st_contains.json | 2 +- .../definition/functions/st_disjoint.json | 2 +- .../definition/functions/st_intersects.json | 2 +- .../definition/functions/st_within.json | 2 +- .../esql/kibana/definition/functions/tau.json | 2 +- .../functions/to_cartesianpoint.json | 2 +- .../functions/to_cartesianshape.json | 2 +- .../definition/functions/to_datetime.json | 2 +- .../definition/functions/to_geopoint.json | 2 +- .../definition/functions/to_geoshape.json | 2 +- .../kibana/definition/functions/values.json | 2 +- .../esql/kibana/definition/operators/add.json | 2 +- .../kibana/definition/operators/cast.json | 2 +- .../esql/kibana/definition/operators/div.json | 4 +- .../kibana/definition/operators/equals.json | 4 +- .../definition/operators/greater_than.json | 4 +- .../operators/greater_than_or_equal.json | 4 +- .../definition/operators/is_not_null.json | 194 ++++++++++++++++++ .../kibana/definition/operators/is_null.json | 194 ++++++++++++++++++ .../definition/operators/less_than.json | 4 +- .../operators/less_than_or_equal.json | 4 +- .../definition/operators/match_operator.json | 2 +- .../esql/kibana/definition/operators/mod.json | 2 +- .../esql/kibana/definition/operators/mul.json | 2 +- .../definition/operators/not rlike.json | 2 +- .../definition/operators/not_equals.json | 4 +- .../kibana/definition/operators/rlike.json | 2 +- .../esql/kibana/definition/operators/sub.json | 2 +- .../esql/kibana/docs/operators/is_not_null.md | 12 ++ .../esql/kibana/docs/operators/is_null.md | 14 ++ .../expression/function/DocsV3Support.java | 5 +- .../operator/NullPredicatesTests.java | 103 +++++++++- 47 files changed, 635 insertions(+), 53 deletions(-) create mode 100644 docs/reference/query-languages/esql/_snippets/operators/examples/is_not_null.md create mode 100644 docs/reference/query-languages/esql/_snippets/operators/examples/is_null.md create mode 100644 docs/reference/query-languages/esql/_snippets/operators/types/is_not_null.md create mode 100644 docs/reference/query-languages/esql/_snippets/operators/types/is_null.md create mode 100644 docs/reference/query-languages/esql/images/operators/is_not_null.svg create mode 100644 docs/reference/query-languages/esql/images/operators/is_null.svg create mode 100644 docs/reference/query-languages/esql/kibana/definition/operators/is_not_null.json create mode 100644 docs/reference/query-languages/esql/kibana/definition/operators/is_null.json create mode 100644 docs/reference/query-languages/esql/kibana/docs/operators/is_not_null.md create mode 100644 docs/reference/query-languages/esql/kibana/docs/operators/is_null.md diff --git a/docs/reference/query-languages/esql/_snippets/operators/examples/is_not_null.md b/docs/reference/query-languages/esql/_snippets/operators/examples/is_not_null.md new file mode 100644 index 0000000000000..c3b5e1fff6ac3 --- /dev/null +++ b/docs/reference/query-languages/esql/_snippets/operators/examples/is_not_null.md @@ -0,0 +1,15 @@ +% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. + +**Example** + +```esql +FROM employees +| WHERE is_rehired IS NOT NULL +| STATS COUNT(emp_no) +``` + +| COUNT(emp_no):long | +| --- | +| 84 | + + diff --git a/docs/reference/query-languages/esql/_snippets/operators/examples/is_null.md b/docs/reference/query-languages/esql/_snippets/operators/examples/is_null.md new file mode 100644 index 0000000000000..f27870719e979 --- /dev/null +++ b/docs/reference/query-languages/esql/_snippets/operators/examples/is_null.md @@ -0,0 +1,19 @@ +% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. + +**Example** + +```esql +FROM employees +| WHERE birth_date IS NULL +| KEEP first_name, last_name +| SORT first_name +| LIMIT 3 +``` + +| first_name:keyword | last_name:keyword | +| --- | --- | +| Basil | Tramer | +| Florian | Syrotiuk | +| Lucien | Rosenbaum | + + diff --git a/docs/reference/query-languages/esql/_snippets/operators/types/is_not_null.md b/docs/reference/query-languages/esql/_snippets/operators/types/is_not_null.md new file mode 100644 index 0000000000000..986c99c3cb457 --- /dev/null +++ b/docs/reference/query-languages/esql/_snippets/operators/types/is_not_null.md @@ -0,0 +1,22 @@ +% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. + +**Supported types** + +| field | result | +| --- | --- | +| boolean | boolean | +| cartesian_point | boolean | +| cartesian_shape | boolean | +| date | boolean | +| date_nanos | boolean | +| double | boolean | +| geo_point | boolean | +| geo_shape | boolean | +| integer | boolean | +| ip | boolean | +| keyword | boolean | +| long | boolean | +| text | boolean | +| unsigned_long | boolean | +| version | boolean | + diff --git a/docs/reference/query-languages/esql/_snippets/operators/types/is_null.md b/docs/reference/query-languages/esql/_snippets/operators/types/is_null.md new file mode 100644 index 0000000000000..986c99c3cb457 --- /dev/null +++ b/docs/reference/query-languages/esql/_snippets/operators/types/is_null.md @@ -0,0 +1,22 @@ +% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. + +**Supported types** + +| field | result | +| --- | --- | +| boolean | boolean | +| cartesian_point | boolean | +| cartesian_shape | boolean | +| date | boolean | +| date_nanos | boolean | +| double | boolean | +| geo_point | boolean | +| geo_shape | boolean | +| integer | boolean | +| ip | boolean | +| keyword | boolean | +| long | boolean | +| text | boolean | +| unsigned_long | boolean | +| version | boolean | + diff --git a/docs/reference/query-languages/esql/images/operators/is_not_null.svg b/docs/reference/query-languages/esql/images/operators/is_not_null.svg new file mode 100644 index 0000000000000..1829ec7bdb9d6 --- /dev/null +++ b/docs/reference/query-languages/esql/images/operators/is_not_null.svg @@ -0,0 +1 @@ +IS NOT NULLv \ No newline at end of file diff --git a/docs/reference/query-languages/esql/images/operators/is_null.svg b/docs/reference/query-languages/esql/images/operators/is_null.svg new file mode 100644 index 0000000000000..1a632b5e49115 --- /dev/null +++ b/docs/reference/query-languages/esql/images/operators/is_null.svg @@ -0,0 +1 @@ +IS NULLv \ No newline at end of file diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/greatest.json b/docs/reference/query-languages/esql/kibana/definition/functions/greatest.json index 0c095018d56f5..cf7ebcf603e2c 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/greatest.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/greatest.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "greatest", - "description" : "Returns the maximum value from multiple columns. This is similar to <>\nexcept it is intended to run on multiple columns at once.", + "description" : "Returns the maximum value from multiple columns. This is similar to `MV_MAX`\nexcept it is intended to run on multiple columns at once.", "note" : "When run on `keyword` or `text` fields, this returns the last string in alphabetical order. When run on `boolean` columns this will return `true` if any values are `true`.", "signatures" : [ { diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/least.json b/docs/reference/query-languages/esql/kibana/definition/functions/least.json index 42ad9b567e4c6..d5ede3b842232 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/least.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/least.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "least", - "description" : "Returns the minimum value from multiple columns. This is similar to <> except it is intended to run on multiple columns at once.", + "description" : "Returns the minimum value from multiple columns. This is similar to `MV_MIN` except it is intended to run on multiple columns at once.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/match.json b/docs/reference/query-languages/esql/kibana/definition/functions/match.json index f455097b206d2..bad4974795f69 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/match.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/match.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "match", - "description" : "Use `MATCH` to perform a <> on the specified field.\nUsing `MATCH` is equivalent to using the `match` query in the Elasticsearch Query DSL.\n\nMatch can be used on fields from the text family like <> and <>,\nas well as other field types like keyword, boolean, dates, and numeric types.\n\nMatch can use <> to specify additional options for the match query.\nAll <> are supported.\n\nFor a simplified syntax, you can use the <> `:` operator instead of `MATCH`.\n\n`MATCH` returns true if the provided query matches the row.", + "description" : "Use `MATCH` to perform a match query on the specified field.\nUsing `MATCH` is equivalent to using the `match` query in the Elasticsearch Query DSL.\n\nMatch can be used on fields from the text family like text and semantic_text,\nas well as other field types like keyword, boolean, dates, and numeric types.\n\nMatch can use function named parameters to specify additional options for the match query.\nAll match query parameters are supported.\n\nFor a simplified syntax, you can use the match operator `:` operator instead of `MATCH`.\n\n`MATCH` returns true if the provided query matches the row.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/median.json b/docs/reference/query-languages/esql/kibana/definition/functions/median.json index 5abb5d87aafda..3c8689ca0fc5d 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/median.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/median.json @@ -2,8 +2,8 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "agg", "name" : "median", - "description" : "The value that is greater than half of all values and less than half of all values, also known as the 50% <>.", - "note" : "Like <>, `MEDIAN` is <>.", + "description" : "The value that is greater than half of all values and less than half of all values, also known as the 50% `PERCENTILE`.", + "note" : "Like `PERCENTILE`, `MEDIAN` is usually approximate.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/median_absolute_deviation.json b/docs/reference/query-languages/esql/kibana/definition/functions/median_absolute_deviation.json index 615a9b6543456..edc42448084e4 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/median_absolute_deviation.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/median_absolute_deviation.json @@ -3,7 +3,7 @@ "type" : "agg", "name" : "median_absolute_deviation", "description" : "Returns the median absolute deviation, a measure of variability. It is a robust statistic, meaning that it is useful for describing data that may have outliers, or may not be normally distributed. For such data it can be more descriptive than standard deviation.\n\nIt is calculated as the median of each data point’s deviation from the median of the entire sample. That is, for a random variable `X`, the median absolute deviation is `median(|median(X) - X|)`.", - "note" : "Like <>, `MEDIAN_ABSOLUTE_DEVIATION` is <>.", + "note" : "Like `PERCENTILE`, `MEDIAN_ABSOLUTE_DEVIATION` is usually approximate.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/mv_first.json b/docs/reference/query-languages/esql/kibana/definition/functions/mv_first.json index 08fbc425bfaa7..6bd512388380f 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/mv_first.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/mv_first.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "mv_first", - "description" : "Converts a multivalued expression into a single valued column containing the\nfirst value. This is most useful when reading from a function that emits\nmultivalued columns in a known order like <>.", + "description" : "Converts a multivalued expression into a single valued column containing the\nfirst value. This is most useful when reading from a function that emits\nmultivalued columns in a known order like `SPLIT`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/mv_last.json b/docs/reference/query-languages/esql/kibana/definition/functions/mv_last.json index 1fd311ed113cc..21d8d669dce7c 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/mv_last.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/mv_last.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "mv_last", - "description" : "Converts a multivalue expression into a single valued column containing the last\nvalue. This is most useful when reading from a function that emits multivalued\ncolumns in a known order like <>.", + "description" : "Converts a multivalue expression into a single valued column containing the last\nvalue. This is most useful when reading from a function that emits multivalued\ncolumns in a known order like `SPLIT`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/mv_slice.json b/docs/reference/query-languages/esql/kibana/definition/functions/mv_slice.json index 03ec525a9f847..149e309249bd9 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/mv_slice.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/mv_slice.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "mv_slice", - "description" : "Returns a subset of the multivalued field using the start and end index values.\nThis is most useful when reading from a function that emits multivalued columns\nin a known order like <> or <>.", + "description" : "Returns a subset of the multivalued field using the start and end index values.\nThis is most useful when reading from a function that emits multivalued columns\nin a known order like `SPLIT` or `MV_SORT`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/qstr.json b/docs/reference/query-languages/esql/kibana/definition/functions/qstr.json index 4774d413d3c3d..0c4f19d2dad0a 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/qstr.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/qstr.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "qstr", - "description" : "Performs a <>. Returns true if the provided query string matches the row.", + "description" : "Performs a query string query. Returns true if the provided query string matches the row.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_contains.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_contains.json index 18119288422a2..a72e6a833c6e3 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_contains.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_contains.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "st_contains", - "description" : "Returns whether the first geometry contains the second geometry.\nThis is the inverse of the <> function.", + "description" : "Returns whether the first geometry contains the second geometry.\nThis is the inverse of the ST_WITHIN function.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_disjoint.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_disjoint.json index adf6570b34c7c..9e00ced00220e 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_disjoint.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_disjoint.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "st_disjoint", - "description" : "Returns whether the two geometries or geometry columns are disjoint.\nThis is the inverse of the <> function.\nIn mathematical terms: ST_Disjoint(A, B) ⇔ A ⋂ B = ∅", + "description" : "Returns whether the two geometries or geometry columns are disjoint.\nThis is the inverse of the ST_INTERSECTS function.\nIn mathematical terms: ST_Disjoint(A, B) ⇔ A ⋂ B = ∅", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_intersects.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_intersects.json index 7c868e1f3c470..6b7d5e844b42a 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_intersects.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_intersects.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "st_intersects", - "description" : "Returns true if two geometries intersect.\nThey intersect if they have any point in common, including their interior points\n(points along lines or within polygons).\nThis is the inverse of the <> function.\nIn mathematical terms: ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅", + "description" : "Returns true if two geometries intersect.\nThey intersect if they have any point in common, including their interior points\n(points along lines or within polygons).\nThis is the inverse of the ST_DISJOINT function.\nIn mathematical terms: ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_within.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_within.json index 8ad01022634cf..94bf11529e041 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_within.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_within.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "st_within", - "description" : "Returns whether the first geometry is within the second geometry.\nThis is the inverse of the <> function.", + "description" : "Returns whether the first geometry is within the second geometry.\nThis is the inverse of the ST_CONTAINS function.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/tau.json b/docs/reference/query-languages/esql/kibana/definition/functions/tau.json index b70980a729b57..86c5cb75b1c1d 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/tau.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/tau.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "tau", - "description" : "Returns the [ratio](https://tauday.com/tau-manifesto) of a circle’s circumference to its radius.", + "description" : "Returns the ratio of a circle’s circumference to its radius.", "signatures" : [ { "params" : [ ], diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianpoint.json b/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianpoint.json index 34db5304c9cac..86561d09a2977 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianpoint.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianpoint.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "to_cartesianpoint", - "description" : "Converts an input value to a `cartesian_point` value.\nA string will only be successfully converted if it respects WKT Point format.", + "description" : "Converts an input value to a `cartesian_point` value.\nA string will only be successfully converted if it respects the\nWKT Point format.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianshape.json b/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianshape.json index 5e7764b8b4410..9c866cfd06c97 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianshape.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianshape.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "to_cartesianshape", - "description" : "Converts an input value to a `cartesian_shape` value.\nA string will only be successfully converted if it respects WKT format.", + "description" : "Converts an input value to a `cartesian_shape` value.\nA string will only be successfully converted if it respects the\nWKT format.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/to_datetime.json b/docs/reference/query-languages/esql/kibana/definition/functions/to_datetime.json index fe58cefb2bb3f..3174709a9917a 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/to_datetime.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/to_datetime.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "to_datetime", - "description" : "Converts an input value to a date value.\nA string will only be successfully converted if it’s respecting the format `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`.\nTo convert dates in other formats, use <>.", + "description" : "Converts an input value to a date value.\nA string will only be successfully converted if it’s respecting the format `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`.\nTo convert dates in other formats, use `DATE_PARSE`.", "note" : "Note that when converting from nanosecond resolution to millisecond resolution with this function, the nanosecond date is truncated, not rounded.", "signatures" : [ { diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/to_geopoint.json b/docs/reference/query-languages/esql/kibana/definition/functions/to_geopoint.json index 86d905b1d2235..15f9a77574377 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/to_geopoint.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/to_geopoint.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "to_geopoint", - "description" : "Converts an input value to a `geo_point` value.\nA string will only be successfully converted if it respects WKT Point format.", + "description" : "Converts an input value to a `geo_point` value.\nA string will only be successfully converted if it respects the\nWKT Point format.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/to_geoshape.json b/docs/reference/query-languages/esql/kibana/definition/functions/to_geoshape.json index 4379222f8b308..bfc6f6c2d437f 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/to_geoshape.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/to_geoshape.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "to_geoshape", - "description" : "Converts an input value to a `geo_shape` value.\nA string will only be successfully converted if it respects WKT format.", + "description" : "Converts an input value to a `geo_shape` value.\nA string will only be successfully converted if it respects the\nWKT format.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/values.json b/docs/reference/query-languages/esql/kibana/definition/functions/values.json index 5d2237522f2fc..d64dc2143fe9c 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/values.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/values.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "agg", "name" : "values", - "description" : "Returns all values in a group as a multivalued field. The order of the returned values isn’t guaranteed. If you need the values returned in order use <>.", + "description" : "Returns all values in a group as a multivalued field. The order of the returned values isn’t guaranteed. If you need the values returned in order use `MV_SORT`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/add.json b/docs/reference/query-languages/esql/kibana/definition/operators/add.json index dbf28679d196e..e96de8ec6b31a 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/add.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/add.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "+", "name" : "add", - "description" : "Add two numbers together. If either field is <> then the result is `null`.", + "description" : "Add two numbers together. If either field is multivalued then the result is `null`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/cast.json b/docs/reference/query-languages/esql/kibana/definition/operators/cast.json index 4983d8ba2f441..ee1459c2f53d8 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/cast.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/cast.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "::", "name" : "cast", - "description" : "The `::` operator provides a convenient alternative syntax to the TO_ [conversion functions](https://www.elastic.co/docs/reference/elasticsearch/query-languages/esql/esql-functions-operators#esql-type-conversion-functions).", + "description" : "The `::` operator provides a convenient alternative syntax to the TO_ conversion functions.", "signatures" : [ ], "examples" : [ "ROW ver = CONCAT((\"0\"::INT + 1)::STRING, \".2.3\")::VERSION" diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/div.json b/docs/reference/query-languages/esql/kibana/definition/operators/div.json index 93ddd93f973af..ce69b6b8408ea 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/div.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/div.json @@ -3,8 +3,8 @@ "type" : "operator", "operator" : "/", "name" : "div", - "description" : "Divide one number by another. If either field is <> then the result is `null`.", - "note" : "Division of two integer types will yield an integer result, rounding towards 0. If you need floating point division, <> one of the arguments to a `DOUBLE`.", + "description" : "Divide one number by another. If either field is multivalued then the result is `null`.", + "note" : "Division of two integer types will yield an integer result, rounding towards 0. If you need floating point division, `Cast (::)` one of the arguments to a `DOUBLE`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/equals.json b/docs/reference/query-languages/esql/kibana/definition/operators/equals.json index 33735e3379eba..a77e8574f72d7 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/equals.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/equals.json @@ -3,8 +3,8 @@ "type" : "operator", "operator" : "==", "name" : "equals", - "description" : "Check if two fields are equal. If either field is <> then the result is `null`.", - "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an <> and <>.", + "description" : "Check if two fields are equal. If either field is multivalued then the result is `null`.", + "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an mapping-index and doc-values.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/greater_than.json b/docs/reference/query-languages/esql/kibana/definition/operators/greater_than.json index 3fa7c689a96f1..74e60ba4f73d8 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/greater_than.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/greater_than.json @@ -3,8 +3,8 @@ "type" : "operator", "operator" : ">", "name" : "greater_than", - "description" : "Check if one field is greater than another. If either field is <> then the result is `null`.", - "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an <> and <>.", + "description" : "Check if one field is greater than another. If either field is multivalued then the result is `null`.", + "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an mapping-index and doc-values.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/greater_than_or_equal.json b/docs/reference/query-languages/esql/kibana/definition/operators/greater_than_or_equal.json index 1de820d71480e..6a2cf137e04c7 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/greater_than_or_equal.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/greater_than_or_equal.json @@ -3,8 +3,8 @@ "type" : "operator", "operator" : ">=", "name" : "greater_than_or_equal", - "description" : "Check if one field is greater than or equal to another. If either field is <> then the result is `null`.", - "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an <> and <>.", + "description" : "Check if one field is greater than or equal to another. If either field is multivalued then the result is `null`.", + "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an mapping-index and doc-values.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/is_not_null.json b/docs/reference/query-languages/esql/kibana/definition/operators/is_not_null.json new file mode 100644 index 0000000000000..8b4e2138792c1 --- /dev/null +++ b/docs/reference/query-languages/esql/kibana/definition/operators/is_not_null.json @@ -0,0 +1,194 @@ +{ + "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", + "type" : "operator", + "operator" : "predicates", + "name" : "is_not_null", + "description" : "Use `IS NOT NULL` to filter data based on whether the field exists or not:", + "signatures" : [ + { + "params" : [ + { + "name" : "field", + "type" : "boolean", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "cartesian_point", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "cartesian_shape", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "date", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "date_nanos", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "double", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "geo_point", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "geo_shape", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "integer", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "ip", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "keyword", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "long", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "text", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "unsigned_long", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "version", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + } + ], + "examples" : [ + "FROM employees\n| WHERE is_rehired IS NOT NULL\n| STATS COUNT(emp_no)" + ], + "preview" : false, + "snapshot_only" : false +} diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/is_null.json b/docs/reference/query-languages/esql/kibana/definition/operators/is_null.json new file mode 100644 index 0000000000000..0241fc9b1f79e --- /dev/null +++ b/docs/reference/query-languages/esql/kibana/definition/operators/is_null.json @@ -0,0 +1,194 @@ +{ + "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", + "type" : "operator", + "operator" : "predicates", + "name" : "is_null", + "description" : "Use `IS NULL` to filter data based on whether the field exists or not.", + "signatures" : [ + { + "params" : [ + { + "name" : "field", + "type" : "boolean", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "cartesian_point", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "cartesian_shape", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "date", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "date_nanos", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "double", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "geo_point", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "geo_shape", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "integer", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "ip", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "keyword", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "long", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "text", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "unsigned_long", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "version", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + } + ], + "examples" : [ + "FROM employees\n| WHERE birth_date IS NULL\n| KEEP first_name, last_name\n| SORT first_name\n| LIMIT 3" + ], + "preview" : false, + "snapshot_only" : false +} diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/less_than.json b/docs/reference/query-languages/esql/kibana/definition/operators/less_than.json index eaefe5a16ebbd..43d7ffc233d7a 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/less_than.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/less_than.json @@ -3,8 +3,8 @@ "type" : "operator", "operator" : "<", "name" : "less_than", - "description" : "Check if one field is less than another. If either field is <> then the result is `null`.", - "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an <> and <>.", + "description" : "Check if one field is less than another. If either field is multivalued then the result is `null`.", + "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an mapping-index and doc-values.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/less_than_or_equal.json b/docs/reference/query-languages/esql/kibana/definition/operators/less_than_or_equal.json index da354e5e2efdb..2070612e47c73 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/less_than_or_equal.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/less_than_or_equal.json @@ -3,8 +3,8 @@ "type" : "operator", "operator" : "<=", "name" : "less_than_or_equal", - "description" : "Check if one field is less than or equal to another. If either field is <> then the result is `null`.", - "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an <> and <>.", + "description" : "Check if one field is less than or equal to another. If either field is multivalued then the result is `null`.", + "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an mapping-index and doc-values.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/match_operator.json b/docs/reference/query-languages/esql/kibana/definition/operators/match_operator.json index 9c47c56d0a7a3..37ec36d46f90b 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/match_operator.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/match_operator.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : ":", "name" : "match_operator", - "description" : "Use the match operator (`:`) to perform a <> on the specified field.\nUsing `:` is equivalent to using the `match` query in the Elasticsearch Query DSL.\n\nThe match operator is equivalent to the <>.\n\nFor using the function syntax, or adding <>, you can use the\n<>.\n\n`:` returns true if the provided query matches the row.", + "description" : "Use the match operator (`:`) to perform a match query on the specified field.\nUsing `:` is equivalent to using the `match` query in the Elasticsearch Query DSL.\n\nThe match operator is equivalent to the match function.\n\nFor using the function syntax, or adding match query parameters, you can use the\nmatch function.\n\n`:` returns true if the provided query matches the row.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/mod.json b/docs/reference/query-languages/esql/kibana/definition/operators/mod.json index 69ecc4e40388f..eeda5e37f5f4f 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/mod.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/mod.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "%", "name" : "mod", - "description" : "Divide one number by another and return the remainder. If either field is <> then the result is `null`.", + "description" : "Divide one number by another and return the remainder. If either field is multivalued then the result is `null`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/mul.json b/docs/reference/query-languages/esql/kibana/definition/operators/mul.json index 163623e03e960..feb441b9213ba 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/mul.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/mul.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "*", "name" : "mul", - "description" : "Multiply two numbers together. If either field is <> then the result is `null`.", + "description" : "Multiply two numbers together. If either field is multivalued then the result is `null`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/not rlike.json b/docs/reference/query-languages/esql/kibana/definition/operators/not rlike.json index 8ef2462be874a..9015754cb4d57 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/not rlike.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/not rlike.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "not rlike", "name" : "not_rlike", - "description" : "Use `RLIKE` to filter data based on string patterns using using\n<>. `RLIKE` usually acts on a field placed on\nthe left-hand side of the operator, but it can also act on a constant (literal)\nexpression. The right-hand side of the operator represents the pattern.", + "description" : "Use `RLIKE` to filter data based on string patterns using using\nregular expressions. `RLIKE` usually acts on a field placed on\nthe left-hand side of the operator, but it can also act on a constant (literal)\nexpression. The right-hand side of the operator represents the pattern.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/not_equals.json b/docs/reference/query-languages/esql/kibana/definition/operators/not_equals.json index c4dddf0268c6b..de839329765bf 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/not_equals.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/not_equals.json @@ -3,8 +3,8 @@ "type" : "operator", "operator" : "!=", "name" : "not_equals", - "description" : "Check if two fields are unequal. If either field is <> then the result is `null`.", - "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an <> and <>.", + "description" : "Check if two fields are unequal. If either field is multivalued then the result is `null`.", + "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an mapping-index and doc-values.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/rlike.json b/docs/reference/query-languages/esql/kibana/definition/operators/rlike.json index 5d1ddf2cafa24..e1cdddf06bd86 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/rlike.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/rlike.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "RLIKE", "name" : "rlike", - "description" : "Use `RLIKE` to filter data based on string patterns using using\n<>. `RLIKE` usually acts on a field placed on\nthe left-hand side of the operator, but it can also act on a constant (literal)\nexpression. The right-hand side of the operator represents the pattern.", + "description" : "Use `RLIKE` to filter data based on string patterns using using\nregular expressions. `RLIKE` usually acts on a field placed on\nthe left-hand side of the operator, but it can also act on a constant (literal)\nexpression. The right-hand side of the operator represents the pattern.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/sub.json b/docs/reference/query-languages/esql/kibana/definition/operators/sub.json index 63db4a47dadb2..a476a0ae18865 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/sub.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/sub.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "-", "name" : "sub", - "description" : "Subtract one number from another. If either field is <> then the result is `null`.", + "description" : "Subtract one number from another. If either field is multivalued then the result is `null`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/docs/operators/is_not_null.md b/docs/reference/query-languages/esql/kibana/docs/operators/is_not_null.md new file mode 100644 index 0000000000000..2519c1a5375f6 --- /dev/null +++ b/docs/reference/query-languages/esql/kibana/docs/operators/is_not_null.md @@ -0,0 +1,12 @@ + + +### IS_NOT_NULL +Use `IS NOT NULL` to filter data based on whether the field exists or not: + +```esql +FROM employees +| WHERE is_rehired IS NOT NULL +| STATS COUNT(emp_no) +``` diff --git a/docs/reference/query-languages/esql/kibana/docs/operators/is_null.md b/docs/reference/query-languages/esql/kibana/docs/operators/is_null.md new file mode 100644 index 0000000000000..d6258ea91881d --- /dev/null +++ b/docs/reference/query-languages/esql/kibana/docs/operators/is_null.md @@ -0,0 +1,14 @@ + + +### IS_NULL +Use `IS NULL` to filter data based on whether the field exists or not. + +```esql +FROM employees +| WHERE birth_date IS NULL +| KEEP first_name, last_name +| SORT first_name +| LIMIT 3 +``` diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/DocsV3Support.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/DocsV3Support.java index 0d20d90a95c83..fd45abc23e123 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/DocsV3Support.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/DocsV3Support.java @@ -1037,7 +1037,10 @@ void renderKibanaFunctionDefinition(String name, FunctionInfo info, List, DataType>> sortedSignatures() { diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/NullPredicatesTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/NullPredicatesTests.java index 674a7fe77f586..6f9769b516df0 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/NullPredicatesTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/NullPredicatesTests.java @@ -36,14 +36,31 @@ public static void renderDocs() throws IOException { if (System.getProperty("generateDocs") == null) { return; } - DocsV3Support.OperatorConfig op = new DocsV3Support.OperatorConfig( - "predicates", - "IS NULL and IS NOT NULL", - TestCastOperator.class, - DocsV3Support.OperatorCategory.UNARY, - false + renderNullPredicate( + new DocsV3Support.OperatorConfig( + "predicates", + "IS NULL and IS NOT NULL", + TestNullPredicates.class, + DocsV3Support.OperatorCategory.UNARY, + false + ) ); - var docs = new DocsV3Support.OperatorsDocsSupport("predicates", NullPredicatesTests.class, op, NullPredicatesTests::signatures); + renderNullPredicate( + new DocsV3Support.OperatorConfig("is_null", "IS NULL", TestIsNullPredicate.class, DocsV3Support.OperatorCategory.UNARY, false) + ); + renderNullPredicate( + new DocsV3Support.OperatorConfig( + "is_not_null", + "IS NOT NULL", + TestIsNotNullPredicate.class, + DocsV3Support.OperatorCategory.UNARY, + false + ) + ); + } + + private static void renderNullPredicate(DocsV3Support.OperatorConfig op) throws IOException { + var docs = new DocsV3Support.OperatorsDocsSupport(op.name(), NullPredicatesTests.class, op, NullPredicatesTests::signatures); docs.renderSignature(); docs.renderDocs(); } @@ -62,14 +79,82 @@ public static Map, DataType> signatures() { /** * This class only exists to provide FunctionInfo for the documentation */ - public class TestCastOperator { + public class TestNullPredicates { @FunctionInfo( operator = "predicates", returnType = {}, description = "For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates:", examples = { @Example(file = "null", tag = "is-null"), @Example(file = "null", tag = "is-not-null") } ) - public TestCastOperator( + public TestNullPredicates( + @Param( + name = "field", + type = { + "boolean", + "cartesian_point", + "cartesian_shape", + "date", + "date_nanos", + "double", + "geo_point", + "geo_shape", + "integer", + "ip", + "keyword", + "long", + "text", + "unsigned_long", + "version" }, + description = "Input value. The input can be a single- or multi-valued column or an expression." + ) Expression v + ) {} + } + + /** + * This class only exists to provide FunctionInfo for the documentation + */ + public class TestIsNullPredicate { + @FunctionInfo( + operator = "predicates", + returnType = {}, + description = "Use `IS NULL` to filter data based on whether the field exists or not.", + examples = { @Example(file = "null", tag = "is-null") } + ) + public TestIsNullPredicate( + @Param( + name = "field", + type = { + "boolean", + "cartesian_point", + "cartesian_shape", + "date", + "date_nanos", + "double", + "geo_point", + "geo_shape", + "integer", + "ip", + "keyword", + "long", + "text", + "unsigned_long", + "version" }, + description = "Input value. The input can be a single- or multi-valued column or an expression." + ) Expression v + ) {} + } + + /** + * This class only exists to provide FunctionInfo for the documentation + */ + public class TestIsNotNullPredicate { + @FunctionInfo( + operator = "predicates", + returnType = {}, + description = "Use `IS NOT NULL` to filter data based on whether the field exists or not:", + examples = { @Example(file = "null", tag = "is-not-null") } + ) + public TestIsNotNullPredicate( @Param( name = "field", type = { From e6400dc963cae1c2883374eb1823d8055f87b97d Mon Sep 17 00:00:00 2001 From: Craig Taverner Date: Tue, 1 Apr 2025 10:40:58 +0200 Subject: [PATCH 2/2] Use full-stop instead of colon to terminate description --- .../esql/kibana/definition/operators/is_not_null.json | 2 +- .../esql/kibana/definition/operators/predicates.json | 2 +- .../query-languages/esql/kibana/docs/operators/is_not_null.md | 2 +- .../query-languages/esql/kibana/docs/operators/predicates.md | 2 +- .../expression/predicate/operator/NullPredicatesTests.java | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/is_not_null.json b/docs/reference/query-languages/esql/kibana/definition/operators/is_not_null.json index 8b4e2138792c1..9573c5c922406 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/is_not_null.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/is_not_null.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "predicates", "name" : "is_not_null", - "description" : "Use `IS NOT NULL` to filter data based on whether the field exists or not:", + "description" : "Use `IS NOT NULL` to filter data based on whether the field exists or not.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/predicates.json b/docs/reference/query-languages/esql/kibana/definition/operators/predicates.json index 247e356593b32..6c909368787ef 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/predicates.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/predicates.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "predicates", "name" : "predicates", - "description" : "For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates:", + "description" : "For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/docs/operators/is_not_null.md b/docs/reference/query-languages/esql/kibana/docs/operators/is_not_null.md index 2519c1a5375f6..0cd8c059dd4e3 100644 --- a/docs/reference/query-languages/esql/kibana/docs/operators/is_not_null.md +++ b/docs/reference/query-languages/esql/kibana/docs/operators/is_not_null.md @@ -3,7 +3,7 @@ This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../RE --> ### IS_NOT_NULL -Use `IS NOT NULL` to filter data based on whether the field exists or not: +Use `IS NOT NULL` to filter data based on whether the field exists or not. ```esql FROM employees diff --git a/docs/reference/query-languages/esql/kibana/docs/operators/predicates.md b/docs/reference/query-languages/esql/kibana/docs/operators/predicates.md index bd959656d9815..00d3790cd79d9 100644 --- a/docs/reference/query-languages/esql/kibana/docs/operators/predicates.md +++ b/docs/reference/query-languages/esql/kibana/docs/operators/predicates.md @@ -3,7 +3,7 @@ This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../RE --> ### PREDICATES -For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates: +For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates. ```esql FROM employees diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/NullPredicatesTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/NullPredicatesTests.java index 6f9769b516df0..24c27db35a8bc 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/NullPredicatesTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/NullPredicatesTests.java @@ -83,7 +83,7 @@ public class TestNullPredicates { @FunctionInfo( operator = "predicates", returnType = {}, - description = "For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates:", + description = "For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates.", examples = { @Example(file = "null", tag = "is-null"), @Example(file = "null", tag = "is-not-null") } ) public TestNullPredicates( @@ -151,7 +151,7 @@ public class TestIsNotNullPredicate { @FunctionInfo( operator = "predicates", returnType = {}, - description = "Use `IS NOT NULL` to filter data based on whether the field exists or not:", + description = "Use `IS NOT NULL` to filter data based on whether the field exists or not.", examples = { @Example(file = "null", tag = "is-not-null") } ) public TestIsNotNullPredicate(