Skip to content

Commit

Permalink
Fix aggregation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Druue committed Dec 4, 2023
1 parent 14c206b commit 20a8420
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions query-engine/query-structure/src/query_arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,26 @@ impl QueryArguments {
}

pub fn requires_inmemory_distinct(&self) -> bool {
!self.has_distincton_preview() || !self.has_distinct_capability() || self.has_orderby()
self.distinct.is_some() && !self.can_distinct_in_db()
}

fn has_distincton_preview(&self) -> bool {
self.model()
fn can_distinct_in_db(&self) -> bool {
let has_distinct_feature = self
.model()
.dm
.schema
.configuration
.preview_features()
.contains(PreviewFeature::DistinctOn)
}
.contains(PreviewFeature::DistinctOn);

fn has_distinct_capability(&self) -> bool {
self.model()
let connector_can_distinct_in_db = self
.model()
.dm
.schema
.connector
.has_capability(ConnectorCapability::DistinctOn)
}
.has_capability(ConnectorCapability::DistinctOn);

fn has_orderby(&self) -> bool {
!self.order_by.is_empty()
has_distinct_feature && connector_can_distinct_in_db && self.order_by.is_empty()
}

/// An unstable cursor is a cursor that is used in conjunction with an unstable (non-unique) combination of orderBys.
Expand Down

0 comments on commit 20a8420

Please sign in to comment.