Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(streaming): compile error in count distinct #3163

Merged
merged 1 commit into from
Jun 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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