Skip to content

Commit

Permalink
better fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
yyy1000 committed May 28, 2024
1 parent 288a671 commit acb6171
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions datafusion/sql/src/unparser/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,22 +274,18 @@ impl Unparser<'_> {
)
}
LogicalPlan::Distinct(distinct) => {
let now_distinct = match distinct {
Distinct::All(_) => ast::Distinct::Distinct,
let (select_distinct, input) = match distinct {
Distinct::All(input) => (ast::Distinct::Distinct, input.as_ref()),
Distinct::On(on) => {
let exprs = on
.on_expr
.iter()
.map(|e| self.expr_to_sql(e))
.collect::<Result<Vec<_>>>()?;
ast::Distinct::On(exprs)
(ast::Distinct::On(exprs), on.input.as_ref())
}
};
let input = match distinct {
Distinct::All(input) => input,
Distinct::On(on) => on.input.as_ref(),
};
select.distinct(Some(now_distinct));
select.distinct(Some(select_distinct));
self.select_to_sql_recursively(input, query, select, relation)
}
LogicalPlan::Join(join) => {
Expand Down

0 comments on commit acb6171

Please sign in to comment.