refactor: error on unsupported aggregates
@@ -53,6 +53,9 @@ pub enum Error {
#[snafu(display("unsupported operation: {}", msg))]
UnsupportedOperation { msg: String },
+
+ #[snafu(display("unsupported aggregate: {}", agg))]
+ UnsupportedAggregate { agg: AggregateType },
}
pub type Result<T, E = Error> = std::result::Result<T, E>;
@@ -285,6 +288,15 @@ impl Database {
)
}
+ for (_, agg) in &aggregates {
+ match agg {
+ AggregateType::First | AggregateType::Last => {
+ return Err(Error::UnsupportedAggregate { agg: *agg });
+ }
+ _ => {}
+ }
+ }
+
Ok(ReadAggregateResults::new(
chunks,
table_name,
