pepijnve commented on code in PR #18625:
URL: https://github.com/apache/datafusion/pull/18625#discussion_r2515483139


##########
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:
   For better or worse 'unknown' is the common term in three-value logic and is 
what `IS UNKNOWN` refers to. See 
https://en.wikipedia.org/wiki/Three-valued_logic. I did find usage of 
'uncertain' in Oracle documentation as well though 
https://docs.oracle.com/html/E79061_01/Content/Reference/Truth_tables.htm.
   
   `NULL` is a bit more generic in the sense that `UNKNOWN` is specifically a 
boolean, while `NULL` can be any typed.
   
   I'll admit it's hard to name these things properly and it's rather 
unfortunate that `Interval::UNCERTAIN` already exists.



-- 
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]

Reply via email to