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

feat: support state_agg and duration_in for state_agg #1423

Merged
merged 1 commit into from Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 11 additions & 3 deletions query_server/query/benches/aggregate_function.rs
Expand Up @@ -35,13 +35,21 @@ fn criterion_benchmark(c: &mut Criterion) {
});
}

let mut group = c.benchmark_group("gauge_agg");
group
let mut gauge_agg_group = c.benchmark_group("gauge_agg");
gauge_agg_group
.sample_size(10)
.bench_function("aggregate_query_gauge_agg", |b| {
b.iter(|| data_utils::query(ctx.clone(), "select gauge_agg(ts, f64) FROM t"))
});
group.finish();
gauge_agg_group.finish();

let mut state_agg_group = c.benchmark_group("state_agg");
state_agg_group
.sample_size(10)
.bench_function("aggregate_query_state_agg", |b| {
b.iter(|| data_utils::query(ctx.clone(), "select state_agg(ts, f64) from t"))
});
state_agg_group.finish();

c.bench_function("aggregate_query_no_group_by_first", |b| {
b.iter(|| {
Expand Down
Expand Up @@ -18,11 +18,12 @@ use spi::{QueryError, Result};

pub const SAMPLE_UDAF_NAME: &str = "sample";
pub const COMPACT_STATE_AGG_UDAF_NAME: &str = "compact_state_agg";
pub const STATE_AGG_UDAF_NAME: &str = "state_agg";
pub const GAUGE_AGG_UDAF_NAME: &str = "gauge_agg";
pub const FIRST_UDAF_NAME: &str = "first";
pub const LAST_UDAF_NAME: &str = "last";
pub use gauge::GaugeData;
pub use state_agg::{DurationStates, StateAggData, StatePeriods, TimePeriod};
pub use state_agg::StateAggData;

pub fn register_udafs(func_manager: &mut dyn FunctionMetadataManager) -> Result<()> {
// extend function...
Expand Down