mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-28 19:00:39 +00:00
feat: pushdown select distinct in some cases (#5847)
* feat: pushdown select distinct * test: add sqlness test * test: fix analyzer test
This commit is contained in:
@@ -489,13 +489,7 @@ mod test {
|
||||
|
||||
let config = ConfigOptions::default();
|
||||
let result = DistPlannerAnalyzer {}.analyze(plan, &config).unwrap();
|
||||
let expected = [
|
||||
"Sort: t.number ASC NULLS LAST",
|
||||
" Distinct:",
|
||||
" Projection: t.number",
|
||||
" MergeScan [is_placeholder=false]",
|
||||
]
|
||||
.join("\n");
|
||||
let expected = ["Projection: t.number", " MergeScan [is_placeholder=false]"].join("\n");
|
||||
assert_eq!(expected, result.to_string());
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,13 @@ impl Categorizer {
|
||||
LogicalPlan::Extension(extension) => {
|
||||
Self::check_extension_plan(extension.node.as_ref() as _)
|
||||
}
|
||||
LogicalPlan::Distinct(_) => Commutativity::Unimplemented,
|
||||
LogicalPlan::Distinct(_) => {
|
||||
if partition_cols.is_empty() {
|
||||
Commutativity::Commutative
|
||||
} else {
|
||||
Commutativity::Unimplemented
|
||||
}
|
||||
}
|
||||
LogicalPlan::Unnest(_) => Commutativity::Commutative,
|
||||
LogicalPlan::Statement(_) => Commutativity::Unsupported,
|
||||
LogicalPlan::Values(_) => Commutativity::Unsupported,
|
||||
|
||||
Reference in New Issue
Block a user