You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/06 18:32:44 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #2168: Implement fast path of with_new_children() in ExecutionPlan

alamb commented on code in PR #2168:
URL: https://github.com/apache/arrow-datafusion/pull/2168#discussion_r844259858


##########
ballista/rust/core/src/serde/mod.rs:
##########
@@ -508,15 +508,10 @@ mod tests {
             &self,
             children: Vec<Arc<dyn ExecutionPlan>>,
         ) -> datafusion::error::Result<Arc<dyn ExecutionPlan>> {
-            match children.len() {
-                1 => Ok(Arc::new(TopKExec {
-                    input: children[0].clone(),
-                    k: self.k,
-                })),
-                _ => Err(DataFusionError::Internal(
-                    "TopKExec wrong number of children".to_string(),
-                )),
-            }
+            Ok(Arc::new(TopKExec {

Review Comment:
   What would you think about adding an assert here such as`assert_eq!(children.len(), 1)`  on the theory it might catch bugs faster when making changes?
   
   The same question applies to other `with_new_children` implementations below



##########
datafusion/core/src/physical_plan/mod.rs:
##########
@@ -258,6 +258,32 @@ pub trait ExecutionPlan: Debug + Send + Sync {
     fn statistics(&self) -> Statistics;
 }
 
+/// Returns a new plan where all children were replaced by new plans if the provided children

Review Comment:
   👍 



##########
datafusion/core/src/physical_plan/mod.rs:
##########
@@ -258,6 +258,32 @@ pub trait ExecutionPlan: Debug + Send + Sync {
     fn statistics(&self) -> Statistics;
 }
 
+/// Returns a new plan where all children were replaced by new plans if the provided children

Review Comment:
   👍 



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org