mingmwang commented on code in PR #6084:
URL: https://github.com/apache/arrow-datafusion/pull/6084#discussion_r1177295506
##########
datafusion/expr/src/logical_plan/plan.rs:
##########
@@ -484,6 +484,97 @@ impl LogicalPlan {
_ => Ok(self),
}
}
+
+ /// Returns the maximum number of rows that this plan can output.
+ pub fn max_rows(self: &LogicalPlan) -> Option<usize> {
+ match self {
+ LogicalPlan::Projection(Projection { input, .. }) =>
input.max_rows(),
+ LogicalPlan::Filter(Filter { input, .. }) => input.max_rows(),
+ LogicalPlan::Window(Window { input, .. }) => input.max_rows(),
+ LogicalPlan::Aggregate(Aggregate {
+ input, group_expr, ..
+ }) => {
+ if group_expr.is_empty() {
+ Some(1)
+ } else {
+ input.max_rows()
+ }
Review Comment:
Good point. I will try add this in this PR.
--
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]