rdettai commented on a change in pull request #965:
URL: https://github.com/apache/arrow-datafusion/pull/965#discussion_r706860145



##########
File path: datafusion/src/physical_plan/limit.rs
##########
@@ -135,6 +135,27 @@ impl ExecutionPlan for GlobalLimitExec {
             }
         }
     }
+
+    fn statistics(&self) -> Statistics {
+        let input_stats = self.input.statistics();
+        match input_stats {
+            // if the input does not reach the limit globally, return input 
stats
+            Statistics {
+                num_rows: Some(nr), ..
+            } if nr <= self.limit => input_stats,
+            // if the input is greater than the limit, the num_row will be the 
limit
+            // but we won't be able to predict the other statistics
+            Statistics {
+                num_rows: Some(nr), ..
+            } if nr > self.limit => Statistics {
+                num_rows: Some(self.limit),
+                is_exact: input_stats.is_exact,

Review comment:
       See 
https://github.com/apache/arrow-datafusion/pull/965#issuecomment-917665454

##########
File path: datafusion/src/physical_plan/hash_join.rs
##########
@@ -462,6 +462,13 @@ impl ExecutionPlan for HashJoinExec {
     fn metrics(&self) -> Option<MetricsSet> {
         Some(self.metrics.clone_inner())
     }
+
+    fn statistics(&self) -> Statistics {
+        // TODO stats: it is not possible in general to know the output size 
of joins

Review comment:
       See 
https://github.com/apache/arrow-datafusion/pull/965#issuecomment-917665454

##########
File path: datafusion/src/physical_plan/filter.rs
##########
@@ -144,6 +144,11 @@ impl ExecutionPlan for FilterExec {
     fn metrics(&self) -> Option<MetricsSet> {
         Some(self.metrics.clone_inner())
     }
+
+    /// The output statistics of a filtering operation are unknown

Review comment:
       See 
https://github.com/apache/arrow-datafusion/pull/965#issuecomment-917665454




-- 
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]


Reply via email to