andygrove commented on code in PR #3189:
URL: https://github.com/apache/arrow-datafusion/pull/3189#discussion_r949575221
##########
datafusion/common/src/scalar.rs:
##########
@@ -726,6 +726,24 @@ impl ScalarValue {
}
}
+ /// whether this value is true or not.
+ pub fn is_true(&self) -> bool {
+ match self {
+ ScalarValue::Boolean(v) => v.eq(&Some(true)),
+ ScalarValue::Null => false,
+ other => panic!("Cannot apply 'IS TRUE' to arguments of type '{}
IS TRUE'. Supported form(s): '<BOOLEAN> IS TRUE'", other)
+ }
+ }
+
+ /// whether this value is false or not.
+ pub fn is_false(&self) -> bool {
+ match self {
+ ScalarValue::Boolean(v) => v.eq(&Some(false)),
Review Comment:
```suggestion
ScalarValue::Boolean(&Some(false)) => true,
```
--
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]