Skip to content

Commit 06c33cf

Browse files
authored
Minor: Add comments about initial value for BitAnd accumulator (#6964)
1 parent 16303ad commit 06c33cf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

datafusion/physical-expr/src/aggregate/bit_and_or_xor.rs

+3
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ impl AggregateExpr for BitAnd {
278278

279279
fn create_groups_accumulator(&self) -> Result<Box<dyn GroupsAccumulator>> {
280280
use std::ops::BitAndAssign;
281+
// Note the default value for BitAnd should be all set
282+
// (e.g. `0b11...111`) use MAX / -1 here to get appropriate
283+
// bit pattern for each type
281284
match self.data_type {
282285
DataType::Int8 => {
283286
instantiate_accumulator!(self, -1, Int8Type, |x, y| x.bitand_assign(y))

0 commit comments

Comments
 (0)