fix: distinct respect in range (#5015)

* fix: distinct respect in range

* tests: sqlness

* chore: newline
This commit is contained in:
discord9
2024-11-18 20:11:07 +08:00
committed by GitHub
parent c199604ece
commit 4402f638cd
3 changed files with 80 additions and 2 deletions

View File

@@ -773,6 +773,8 @@ impl RangeSelect {
} else {
vec![]
};
let distinct = aggr.distinct;
// TODO(discord9): add default null treatment?
let input_phy_exprs = self.create_physical_expr_list(
matches!(
@@ -786,7 +788,7 @@ impl RangeSelect {
match &aggr.func_def {
AggregateFunctionDefinition::BuiltIn(fun) => create_aggr_expr(
fun,
false,
distinct,
&input_phy_exprs,
&order_by,
&input_schema,
@@ -801,7 +803,7 @@ impl RangeSelect {
&input_schema,
name,
false,
false,
distinct,
),
}
}