liukun4515 commented on code in PR #5132:
URL: https://github.com/apache/arrow-datafusion/pull/5132#discussion_r1100144125
##########
datafusion/expr/src/logical_plan/builder.rs:
##########
@@ -403,6 +403,28 @@ impl LogicalPlanBuilder {
Ok(())
})?;
+ // if current plan is distinct or current plan is repartition and its
child plan is distinct,
+ // then this plan is a select distinct plan
+ let is_select_distinct = match self.plan {
+ LogicalPlan::Distinct(_) => true,
+ LogicalPlan::Repartition(Repartition { ref input, .. }) => {
+ matches!(input.as_ref(), &LogicalPlan::Distinct(_))
+ }
+ _ => false,
Review Comment:
is there no other pattern to fit this case?
just below cases?
```
sort column1
repartition
distinct
```
```
sort column1
distinct
```
cc @alamb
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]