pepijnve commented on code in PR #18625:
URL: https://github.com/apache/datafusion/pull/18625#discussion_r2515542342
##########
datafusion/expr-common/src/interval_arithmetic.rs:
##########
@@ -1738,6 +1738,44 @@ impl From<ScalarValue> for NullableInterval {
}
impl NullableInterval {
+ /// An interval that only contains 'false'.
+ pub const FALSE: Self = NullableInterval::NotNull {
+ values: Interval::CERTAINLY_FALSE,
+ };
+
+ /// An interval that only contains 'true'.
+ pub const TRUE: Self = NullableInterval::NotNull {
+ values: Interval::CERTAINLY_TRUE,
+ };
+
+ /// An interval that only contains 'unknown' (boolean null).
+ pub const UNKNOWN: Self = NullableInterval::Null {
Review Comment:
Finally got me a copy of the SQL spec. The spec says the following:
> The Boolean data type comprises the distinct truth values True and False.
Unless prohibited by a NOT
NULL constraint, the Boolean data type also supports the truth value Unknown
as the null value. This
specification does not make a distinction between the null value of the
Boolean data type and the truth
value Unknown that is the result of an SQL `<predicate>`, `<search
condition>`, or `<boolean value expression>`; they may be used interchangeably
to mean exactly the same thing.
So the three truth values are name 'True', 'False' and 'Unknown'. And
'Unknown' is specifically equivalent to boolean null.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]