crepererum commented on code in PR #6844:
URL: https://github.com/apache/arrow-datafusion/pull/6844#discussion_r1252215001


##########
datafusion/physical-expr/src/aggregate/bool_and_or.rs:
##########
@@ -219,23 +218,26 @@ impl PartialEq<dyn Any> for BoolAnd {
 
 #[derive(Debug)]
 struct BoolAndAccumulator {
-    bool_and: ScalarValue,
+    acc: Option<bool>,
 }
 
 impl BoolAndAccumulator {
     /// new bool_and accumulator
     pub fn try_new(data_type: &DataType) -> Result<Self> {
-        Ok(Self {
-            bool_and: ScalarValue::try_from(data_type)?,
-        })
+        assert_eq!(data_type, &DataType::Boolean);
+        Ok(Self { acc: None })
     }

Review Comment:
   If you just assert the `DataType` to be one constant value, then you can 
also just remove the parameter and return `Self`.



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

Reply via email to