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

chore: allow empty group by for agg index #12542

Merged
merged 2 commits into from
Aug 22, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ impl VisitorMut for AggregatingIndexRewriter {
}
_ => unreachable!(),
}
} else {
let groups = vec![block_name_expr];
*group_by = Some(GroupBy::Normal(groups));
}
}
}
3 changes: 2 additions & 1 deletion src/query/sql/src/planner/semantic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ pub use type_check::validate_function_arg;
pub use type_check::TypeChecker;
pub use window_check::WindowChecker;

pub(crate) const SUPPORTED_AGGREGATING_INDEX_FUNCTIONS: [&str; 4] = ["sum", "min", "max", "avg"];
pub(crate) const SUPPORTED_AGGREGATING_INDEX_FUNCTIONS: [&str; 5] =
["sum", "min", "max", "avg", "approx_count_distinct"];
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ DROP AGGREGATING INDEX testi
statement ok
DROP TABLE t

# test sync agg index
statement ok
SET enable_refresh_aggregating_index_after_write=1;

Expand Down