From 4b7ff2488f8324c0c093ea21106799aa392a5cb4 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Sat, 4 Nov 2023 06:24:23 -0400 Subject: [PATCH 1/2] Minor: improve documentation for IsNotNull, DISTINCT, etc --- datafusion/expr/src/expr.rs | 16 ++++++++-------- datafusion/expr/src/operator.rs | 8 ++++++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/datafusion/expr/src/expr.rs b/datafusion/expr/src/expr.rs index 239a3188502c..8929b21f4412 100644 --- a/datafusion/expr/src/expr.rs +++ b/datafusion/expr/src/expr.rs @@ -99,21 +99,21 @@ pub enum Expr { SimilarTo(Like), /// Negation of an expression. The expression's type must be a boolean to make sense. Not(Box), - /// Whether an expression is not Null. This expression is never null. + /// True if argument is not NULL, false otherwise. This expression itself is never NULL. IsNotNull(Box), - /// Whether an expression is Null. This expression is never null. + /// True if argument is NULL, false otherwise. This expression itself is never NULL. IsNull(Box), - /// Whether an expression is True. Boolean operation + /// True if argument is true, false otherwise. This expression itself is never NULL. IsTrue(Box), - /// Whether an expression is False. Boolean operation + /// True if argument is false, false otherwise. This expression itself is never NULL. IsFalse(Box), - /// Whether an expression is Unknown. Boolean operation + /// True if argument is NULL, false otherwise. This expression itself is never NULL. IsUnknown(Box), - /// Whether an expression is not True. Boolean operation + /// True if argument is FALSE or NULL, false otherwise. This expression itself is never NULL. IsNotTrue(Box), - /// Whether an expression is not False. Boolean operation + /// True if argument is TRUE OR NULL, false otherwise. This expression itself is never NULL. IsNotFalse(Box), - /// Whether an expression is not Unknown. Boolean operation + /// True if argument is TRUE or FALSE, false otherwise. This expression itself is never NULL. IsNotUnknown(Box), /// arithmetic negation of an expression, the operand must be of a signed numeric data type Negative(Box), diff --git a/datafusion/expr/src/operator.rs b/datafusion/expr/src/operator.rs index 1790f1478927..b5394fac53a4 100644 --- a/datafusion/expr/src/operator.rs +++ b/datafusion/expr/src/operator.rs @@ -53,9 +53,13 @@ pub enum Operator { And, /// Logical OR, like `||` Or, - /// IS DISTINCT FROM + /// `IS DISTINCT FROM` (see [`distinct`]) + /// + /// [distinct]: arrow::compute::kernels::cmp::distinct IsDistinctFrom, - /// IS NOT DISTINCT FROM + /// `IS NOT DISTINCT FROM` (see [`not_distinct`]) + /// + /// [not_distinct]: arrow::compute::kernels::cmp::not_distinct IsNotDistinctFrom, /// Case sensitive regex match RegexMatch, From b85b91c5119417d28d6d2de1d7aea8e603e4188a Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Sat, 4 Nov 2023 06:34:09 -0400 Subject: [PATCH 2/2] fix --- datafusion/expr/src/operator.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datafusion/expr/src/operator.rs b/datafusion/expr/src/operator.rs index b5394fac53a4..57888a11d426 100644 --- a/datafusion/expr/src/operator.rs +++ b/datafusion/expr/src/operator.rs @@ -55,11 +55,11 @@ pub enum Operator { Or, /// `IS DISTINCT FROM` (see [`distinct`]) /// - /// [distinct]: arrow::compute::kernels::cmp::distinct + /// [`distinct`]: arrow::compute::kernels::cmp::distinct IsDistinctFrom, /// `IS NOT DISTINCT FROM` (see [`not_distinct`]) /// - /// [not_distinct]: arrow::compute::kernels::cmp::not_distinct + /// [`not_distinct`]: arrow::compute::kernels::cmp::not_distinct IsNotDistinctFrom, /// Case sensitive regex match RegexMatch,