Skip to content

Commit

Permalink
fix(streaming): compile error in count distinct (#3163)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Chi <[email protected]>
  • Loading branch information
skyzh authored Jun 13, 2022
1 parent 725c459 commit dc2a9ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/stream/src/executor/aggregation/approx_count_distinct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use risingwave_common::error::{ErrorCode, Result};
use risingwave_common::types::{Datum, DatumRef, Scalar, ScalarImpl};

use super::StreamingAggStateImpl;
use crate::executor::error::StreamExecutorResult;

const INDEX_BITS: u8 = 14; // number of bits used for finding the index of each 64-bit hash
const NUM_OF_REGISTERS: usize = 1 << INDEX_BITS; // number of registers available
Expand Down Expand Up @@ -217,7 +218,7 @@ impl StreamingAggStateImpl for StreamingApproxCountDistinct {
ops: Ops<'_>,
visibility: Option<&Bitmap>,
data: &[&ArrayImpl],
) -> Result<()> {
) -> StreamExecutorResult<()> {
match visibility {
None => {
for (op, datum) in ops.iter().zip_eq(data[0].iter()) {
Expand All @@ -243,7 +244,7 @@ impl StreamingAggStateImpl for StreamingApproxCountDistinct {
Ok(())
}

fn get_output(&self) -> Result<Datum> {
fn get_output(&self) -> StreamExecutorResult<Datum> {
let m = NUM_OF_REGISTERS as f64;
let mut mean = 0.0;

Expand Down

0 comments on commit dc2a9ef

Please sign in to comment.