From f197885326fa9324535b2123d3e06db6b058c991 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 18 Jun 2025 16:50:21 -0400 Subject: [PATCH 1/3] ESQL: Add counters to signature for `IS NULL` This adds `counter_long` and `counter_double` to the signatures of supported fields for `IS NULL` and `IS NOT NULL`. We hadn't been generating those signatures since the docs v3 migration, so this had to plug those in. In addition, it changes the wording on a few things and adds a note that if a field is only in some documents then the ones missing the field will have `NULL` - which is important information for `IS NULL` and `IS NOT NULL`. --- .../detailedDescription/is_not_null.md | 6 ++ .../operators/detailedDescription/is_null.md | 6 ++ .../_snippets/operators/types/is_not_null.md | 3 + .../esql/_snippets/operators/types/is_null.md | 3 + .../definition/operators/is_not_null.json | 72 ++++++++++++++----- .../kibana/definition/operators/is_null.json | 72 ++++++++++++++----- .../esql/kibana/docs/operators/is_not_null.md | 8 +-- .../esql/kibana/docs/operators/is_null.md | 7 +- .../expression/predicate/nulls/IsNotNull.java | 39 +++++++++- .../expression/predicate/nulls/IsNull.java | 39 +++++++++- .../function/scalar/nulls/IsNotNullTests.java | 2 +- .../function/scalar/nulls/IsNullTests.java | 2 +- 12 files changed, 206 insertions(+), 53 deletions(-) create mode 100644 docs/reference/query-languages/esql/_snippets/operators/detailedDescription/is_not_null.md create mode 100644 docs/reference/query-languages/esql/_snippets/operators/detailedDescription/is_null.md diff --git a/docs/reference/query-languages/esql/_snippets/operators/detailedDescription/is_not_null.md b/docs/reference/query-languages/esql/_snippets/operators/detailedDescription/is_not_null.md new file mode 100644 index 0000000000000..fb5acb31cbd08 --- /dev/null +++ b/docs/reference/query-languages/esql/_snippets/operators/detailedDescription/is_not_null.md @@ -0,0 +1,6 @@ + +::::{note} +If a field is only in some documents it will be `NULL` in the documents that did not contain it. +:::: + + diff --git a/docs/reference/query-languages/esql/_snippets/operators/detailedDescription/is_null.md b/docs/reference/query-languages/esql/_snippets/operators/detailedDescription/is_null.md new file mode 100644 index 0000000000000..fb5acb31cbd08 --- /dev/null +++ b/docs/reference/query-languages/esql/_snippets/operators/detailedDescription/is_null.md @@ -0,0 +1,6 @@ + +::::{note} +If a field is only in some documents it will be `NULL` in the documents that did not contain it. +:::: + + 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 index 986c99c3cb457..1bd9c655c56ce 100644 --- 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 @@ -7,6 +7,9 @@ | boolean | boolean | | cartesian_point | boolean | | cartesian_shape | boolean | +| counter_double | boolean | +| counter_integer | boolean | +| counter_long | boolean | | date | boolean | | date_nanos | boolean | | double | 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 index 986c99c3cb457..1bd9c655c56ce 100644 --- a/docs/reference/query-languages/esql/_snippets/operators/types/is_null.md +++ b/docs/reference/query-languages/esql/_snippets/operators/types/is_null.md @@ -7,6 +7,9 @@ | boolean | boolean | | cartesian_point | boolean | | cartesian_shape | boolean | +| counter_double | boolean | +| counter_integer | boolean | +| counter_long | boolean | | date | boolean | | date_nanos | boolean | | double | boolean | 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 385d375853683..295a4a5ee4951 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,8 @@ "type" : "operator", "operator" : "IS NOT NULL", "name" : "is_not_null", - "description" : "Use `IS NOT NULL` to filter data based on whether the field exists or not.", + "description" : "Is *not* this null?", + "note" : "If a field is only in some documents it will be `NULL` in the documents that did not contain it.", "signatures" : [ { "params" : [ @@ -11,7 +12,7 @@ "name" : "field", "type" : "boolean", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -23,7 +24,7 @@ "name" : "field", "type" : "cartesian_point", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -35,7 +36,43 @@ "name" : "field", "type" : "cartesian_shape", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "counter_double", + "optional" : false, + "description" : "Value to check. It can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "counter_integer", + "optional" : false, + "description" : "Value to check. It can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "counter_long", + "optional" : false, + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -47,7 +84,7 @@ "name" : "field", "type" : "date", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -59,7 +96,7 @@ "name" : "field", "type" : "date_nanos", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -71,7 +108,7 @@ "name" : "field", "type" : "double", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -83,7 +120,7 @@ "name" : "field", "type" : "geo_point", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -95,7 +132,7 @@ "name" : "field", "type" : "geo_shape", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -107,7 +144,7 @@ "name" : "field", "type" : "integer", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -119,7 +156,7 @@ "name" : "field", "type" : "ip", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -131,7 +168,7 @@ "name" : "field", "type" : "keyword", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -143,7 +180,7 @@ "name" : "field", "type" : "long", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -155,7 +192,7 @@ "name" : "field", "type" : "text", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -167,7 +204,7 @@ "name" : "field", "type" : "unsigned_long", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -179,16 +216,13 @@ "name" : "field", "type" : "version", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It 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 index e1411c65ef3f4..d2ea24c800d5f 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/is_null.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/is_null.json @@ -3,7 +3,8 @@ "type" : "operator", "operator" : "IS NULL", "name" : "is_null", - "description" : "Use `IS NULL` to filter data based on whether the field exists or not.", + "description" : "Is this `NULL`?", + "note" : "If a field is only in some documents it will be `NULL` in the documents that did not contain it.", "signatures" : [ { "params" : [ @@ -11,7 +12,7 @@ "name" : "field", "type" : "boolean", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -23,7 +24,7 @@ "name" : "field", "type" : "cartesian_point", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -35,7 +36,43 @@ "name" : "field", "type" : "cartesian_shape", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "counter_double", + "optional" : false, + "description" : "Value to check. It can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "counter_integer", + "optional" : false, + "description" : "Value to check. It can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "counter_long", + "optional" : false, + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -47,7 +84,7 @@ "name" : "field", "type" : "date", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -59,7 +96,7 @@ "name" : "field", "type" : "date_nanos", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -71,7 +108,7 @@ "name" : "field", "type" : "double", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -83,7 +120,7 @@ "name" : "field", "type" : "geo_point", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -95,7 +132,7 @@ "name" : "field", "type" : "geo_shape", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -107,7 +144,7 @@ "name" : "field", "type" : "integer", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -119,7 +156,7 @@ "name" : "field", "type" : "ip", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -131,7 +168,7 @@ "name" : "field", "type" : "keyword", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -143,7 +180,7 @@ "name" : "field", "type" : "long", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -155,7 +192,7 @@ "name" : "field", "type" : "text", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -167,7 +204,7 @@ "name" : "field", "type" : "unsigned_long", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -179,16 +216,13 @@ "name" : "field", "type" : "version", "optional" : false, - "description" : "Input value. The input can be a single- or multi-valued column or an expression." + "description" : "Value to check. It can be a single- or multi-valued column or an expression." } ], "variadic" : false, "returnType" : "boolean" } ], - "examples" : [ - "FROM employees\n| WHERE birth_date IS NULL" - ], "preview" : false, "snapshot_only" : false } 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 3d9f1e5b81508..4284f323a4553 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 @@ -1,10 +1,6 @@ % This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. ### IS NOT NULL -Use `IS NOT NULL` to filter data based on whether the field exists or not. +Is *not* this null? -```esql -FROM employees -| WHERE is_rehired IS NOT NULL -| STATS COUNT(emp_no) -``` +Note: If a field is only in some documents it will be `NULL` in the documents that did not contain it. 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 index 18abd83b5755f..67a8199059ca3 100644 --- a/docs/reference/query-languages/esql/kibana/docs/operators/is_null.md +++ b/docs/reference/query-languages/esql/kibana/docs/operators/is_null.md @@ -1,9 +1,6 @@ % This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. ### IS NULL -Use `IS NULL` to filter data based on whether the field exists or not. +Is this `NULL`? -```esql -FROM employees -| WHERE birth_date IS NULL -``` +Note: If a field is only in some documents it will be `NULL` in the documents that did not contain it. diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNotNull.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNotNull.java index ce5a660000d09..950d9076c1ef9 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNotNull.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNotNull.java @@ -25,6 +25,8 @@ import org.elasticsearch.xpack.esql.core.tree.Source; import org.elasticsearch.xpack.esql.core.type.DataType; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; +import org.elasticsearch.xpack.esql.expression.function.FunctionInfo; +import org.elasticsearch.xpack.esql.expression.function.Param; import org.elasticsearch.xpack.esql.optimizer.rules.physical.local.LucenePushdownPredicates; import org.elasticsearch.xpack.esql.planner.TranslatorHandler; @@ -37,7 +39,42 @@ public class IsNotNull extends UnaryScalarFunction implements EvaluatorMapper, N IsNotNull::new ); - public IsNotNull(Source source, Expression field) { + @FunctionInfo( + description = "Is *not* this null?", + note = "If a field is only in some documents it will be `NULL` in the documents that did not contain it.", + operator = "IS NOT NULL", + returnType = { + "double", + "integer", + "long", + "date_nanos", + "date_period", + "datetime", + "time_duration", + "unsigned_long", + "counter_long", + "counter_integer", + "counter_double" } + ) + public IsNotNull( + Source source, + @Param( + name = "field", + description = "Value to check. It can be a single- or multi-valued column or an expression.", + type = { + "double", + "integer", + "long", + "date_nanos", + "date_period", + "datetime", + "time_duration", + "unsigned_long", + "counter_long", + "counter_integer", + "counter_double" } + ) Expression field + ) { super(source, field); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNull.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNull.java index fd17a7014e40b..847fa372c08eb 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNull.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNull.java @@ -26,6 +26,8 @@ import org.elasticsearch.xpack.esql.core.tree.Source; import org.elasticsearch.xpack.esql.core.type.DataType; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; +import org.elasticsearch.xpack.esql.expression.function.FunctionInfo; +import org.elasticsearch.xpack.esql.expression.function.Param; import org.elasticsearch.xpack.esql.optimizer.rules.physical.local.LucenePushdownPredicates; import org.elasticsearch.xpack.esql.planner.TranslatorHandler; @@ -34,7 +36,42 @@ public class IsNull extends UnaryScalarFunction implements EvaluatorMapper, Negatable, TranslationAware { public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry(Expression.class, "IsNull", IsNull::new); - public IsNull(Source source, Expression field) { + @FunctionInfo( + description = "Is this `NULL`?", + note = "If a field is only in some documents it will be `NULL` in the documents that did not contain it.", + operator = "IS NULL", + returnType = { + "double", + "integer", + "long", + "date_nanos", + "date_period", + "datetime", + "time_duration", + "unsigned_long", + "counter_long", + "counter_integer", + "counter_double" } + ) + public IsNull( + Source source, + @Param( + name = "field", + description = "Value to check. It can be a single- or multi-valued column or an expression.", + type = { + "double", + "integer", + "long", + "date_nanos", + "date_period", + "datetime", + "time_duration", + "unsigned_long", + "counter_long", + "counter_integer", + "counter_double" } + ) Expression field + ) { super(source, field); } diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/IsNotNullTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/IsNotNullTests.java index 0af5dc7d0ebeb..888eed8e3df09 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/IsNotNullTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/IsNotNullTests.java @@ -34,7 +34,7 @@ public IsNotNullTests(@Name("TestCase") Supplier test public static Iterable parameters() { List suppliers = new ArrayList<>(); for (DataType type : DataType.types()) { - if (false == DataType.isRepresentable(type)) { + if (false == type.isCounter() && false == DataType.isRepresentable(type)) { continue; } if (type != DataType.NULL) { diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/IsNullTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/IsNullTests.java index 4fdc805b18792..6ccc5de5f6d7b 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/IsNullTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/IsNullTests.java @@ -34,7 +34,7 @@ public IsNullTests(@Name("TestCase") Supplier testCas public static Iterable parameters() { List suppliers = new ArrayList<>(); for (DataType type : DataType.types()) { - if (false == DataType.isRepresentable(type)) { + if (false == type.isCounter() && false == DataType.isRepresentable(type)) { continue; } if (type != DataType.NULL) { From 05743bf862b0c1dd8204f4a29ea6e5a0043fcd43 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Fri, 20 Jun 2025 07:09:24 -0400 Subject: [PATCH 2/3] Description --- .../esql/kibana/definition/operators/is_not_null.json | 2 +- .../esql/kibana/definition/operators/is_null.json | 2 +- .../query-languages/esql/kibana/docs/operators/is_not_null.md | 2 +- .../query-languages/esql/kibana/docs/operators/is_null.md | 2 +- .../xpack/esql/expression/predicate/nulls/IsNotNull.java | 2 +- .../xpack/esql/expression/predicate/nulls/IsNull.java | 2 +- 6 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 295a4a5ee4951..818722d93ae0f 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" : "IS NOT NULL", "name" : "is_not_null", - "description" : "Is *not* this null?", + "description" : "Checks if a value *not* is `NULL`.", "note" : "If a field is only in some documents it will be `NULL` in the documents that did not contain it.", "signatures" : [ { 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 index d2ea24c800d5f..845a803487797 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/is_null.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/is_null.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "IS NULL", "name" : "is_null", - "description" : "Is this `NULL`?", + "description" : "Checks if a value is `NULL`.", "note" : "If a field is only in some documents it will be `NULL` in the documents that did not contain it.", "signatures" : [ { 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 4284f323a4553..a62f6bdcf0bf4 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 @@ -1,6 +1,6 @@ % This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. ### IS NOT NULL -Is *not* this null? +Checks if a value *not* is `NULL`. Note: If a field is only in some documents it will be `NULL` in the documents that did not contain it. 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 index 67a8199059ca3..7d77b1ea5a9ca 100644 --- a/docs/reference/query-languages/esql/kibana/docs/operators/is_null.md +++ b/docs/reference/query-languages/esql/kibana/docs/operators/is_null.md @@ -1,6 +1,6 @@ % This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. ### IS NULL -Is this `NULL`? +Checks if a value is `NULL`. Note: If a field is only in some documents it will be `NULL` in the documents that did not contain it. diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNotNull.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNotNull.java index 950d9076c1ef9..8430d24b4fc95 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNotNull.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNotNull.java @@ -40,7 +40,7 @@ public class IsNotNull extends UnaryScalarFunction implements EvaluatorMapper, N ); @FunctionInfo( - description = "Is *not* this null?", + description = "Checks if a value *not* is `NULL`.", note = "If a field is only in some documents it will be `NULL` in the documents that did not contain it.", operator = "IS NOT NULL", returnType = { diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNull.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNull.java index 847fa372c08eb..067838fb74465 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNull.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNull.java @@ -37,7 +37,7 @@ public class IsNull extends UnaryScalarFunction implements EvaluatorMapper, Nega public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry(Expression.class, "IsNull", IsNull::new); @FunctionInfo( - description = "Is this `NULL`?", + description = "Checks if a value is `NULL`.", note = "If a field is only in some documents it will be `NULL` in the documents that did not contain it.", operator = "IS NULL", returnType = { From 9b50dd13b32bec0007b835764e30b30f2e7c249b Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Mon, 23 Jun 2025 14:17:13 -0400 Subject: [PATCH 3/3] update comment --- .../esql/kibana/definition/operators/is_not_null.json | 2 +- .../esql/kibana/definition/operators/is_null.json | 2 +- .../query-languages/esql/kibana/docs/operators/is_not_null.md | 2 +- .../query-languages/esql/kibana/docs/operators/is_null.md | 2 +- .../xpack/esql/expression/predicate/nulls/IsNotNull.java | 2 +- .../xpack/esql/expression/predicate/nulls/IsNull.java | 2 +- 6 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 491fab2587a78..3722fbfaddeb8 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" : "IS NOT NULL", "name" : "is_not_null", - "description" : "Checks if a value *not* is `NULL`.", + "description" : "Returns `false` if the value is `NULL`, `true` otherwise.", "note" : "If a field is only in some documents it will be `NULL` in the documents that did not contain it.", "signatures" : [ { 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 index 5a8407d2133bb..0f6e70f8a0b91 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/is_null.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/is_null.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "IS NULL", "name" : "is_null", - "description" : "Checks if a value is `NULL`.", + "description" : "Returns `true` if the value is `NULL`, `false` otherwise.", "note" : "If a field is only in some documents it will be `NULL` in the documents that did not contain it.", "signatures" : [ { 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 36796db981e4d..25157e2bb7af2 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 @@ -1,6 +1,6 @@ % This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. ### IS NOT NULL -Checks if a value *not* is `NULL`. +Returns `false` if the value is `NULL`, `true` otherwise. Note: If a field is only in some documents it will be `NULL` in the documents that did not contain it. 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 index 05129541de111..625b819935332 100644 --- a/docs/reference/query-languages/esql/kibana/docs/operators/is_null.md +++ b/docs/reference/query-languages/esql/kibana/docs/operators/is_null.md @@ -1,6 +1,6 @@ % This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. ### IS NULL -Checks if a value is `NULL`. +Returns `true` if the value is `NULL`, `false` otherwise. Note: If a field is only in some documents it will be `NULL` in the documents that did not contain it. diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNotNull.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNotNull.java index 8430d24b4fc95..82818c5a329c0 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNotNull.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNotNull.java @@ -40,7 +40,7 @@ public class IsNotNull extends UnaryScalarFunction implements EvaluatorMapper, N ); @FunctionInfo( - description = "Checks if a value *not* is `NULL`.", + description = "Returns `false` if the value is `NULL`, `true` otherwise.", note = "If a field is only in some documents it will be `NULL` in the documents that did not contain it.", operator = "IS NOT NULL", returnType = { diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNull.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNull.java index 067838fb74465..e93124af54186 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNull.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/nulls/IsNull.java @@ -37,7 +37,7 @@ public class IsNull extends UnaryScalarFunction implements EvaluatorMapper, Nega public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry(Expression.class, "IsNull", IsNull::new); @FunctionInfo( - description = "Checks if a value is `NULL`.", + description = "Returns `true` if the value is `NULL`, `false` otherwise.", note = "If a field is only in some documents it will be `NULL` in the documents that did not contain it.", operator = "IS NULL", returnType = {