MCPcopy Create free account
hub / github.com/apache/datafusion / add_hashed

Method add_hashed

datafusion/functions-aggregate/src/hyperloglog.rs:115–119  ·  view source on GitHub ↗
(&mut self, hash: u64)

Source from the content-addressed store, hash-verified

113 /// by [`Self::add`].
114 #[inline]
115 pub(crate) fn add_hashed(&mut self, hash: u64) {
116 let index = (hash & HLL_P_MASK) as usize;
117 let p = ((hash >> HLL_P) | (1_u64 << HLL_Q)).trailing_zeros() + 1;
118 self.registers[index] = self.registers[index].max(p as u8);
119 }
120
121 /// Get the register histogram (each value in register index into
122 /// the histogram; u32 is enough because we only have 2**14=16384 registers

Callers 2

addMethod · 0.80
update_batchMethod · 0.80

Calls 1

maxMethod · 0.45

Tested by

no test coverage detected