This is an automated email from the ASF dual-hosted git repository.
dheres pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 06c33cf0ef Minor: Add comments about initial value for `BitAnd`
accumulator (#6964)
06c33cf0ef is described below
commit 06c33cf0ef3ed826d15e42a2d676a46d66db221a
Author: Andrew Lamb <[email protected]>
AuthorDate: Fri Jul 14 02:03:50 2023 -0400
Minor: Add comments about initial value for `BitAnd` accumulator (#6964)
---
datafusion/physical-expr/src/aggregate/bit_and_or_xor.rs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/datafusion/physical-expr/src/aggregate/bit_and_or_xor.rs
b/datafusion/physical-expr/src/aggregate/bit_and_or_xor.rs
index 6a2d509389..4c7733520e 100644
--- a/datafusion/physical-expr/src/aggregate/bit_and_or_xor.rs
+++ b/datafusion/physical-expr/src/aggregate/bit_and_or_xor.rs
@@ -278,6 +278,9 @@ impl AggregateExpr for BitAnd {
fn create_groups_accumulator(&self) -> Result<Box<dyn GroupsAccumulator>> {
use std::ops::BitAndAssign;
+ // Note the default value for BitAnd should be all set
+ // (e.g. `0b11...111`) use MAX / -1 here to get appropriate
+ // bit pattern for each type
match self.data_type {
DataType::Int8 => {
instantiate_accumulator!(self, -1, Int8Type, |x, y|
x.bitand_assign(y))