alamb commented on code in PR #10427:
URL: https://github.com/apache/datafusion/pull/10427#discussion_r1594510394


##########
datafusion/expr/src/utils.rs:
##########
@@ -885,7 +885,7 @@ pub fn can_hash(data_type: &DataType) -> bool {
 /// Check whether all columns are from the schema.
 pub fn check_all_columns_from_schema(
     columns: &HashSet<Column>,
-    schema: DFSchemaRef,
+    schema: &DFSchema,

Review Comment:
   This takes the schema by reference rather than value now. 
   
   Since `DFSchemaRef` is an `Arc` I don't expect this to make any measurable 
performance improvement, but I think it makes it clearer what is going on and 
avoids a bunch of `clone`s



##########
datafusion/optimizer/src/eliminate_cross_join.rs:
##########
@@ -107,7 +107,7 @@ impl OptimizerRule for EliminateCrossJoin {
             left = find_inner_join(
                 &left,
                 &mut all_inputs,
-                &mut possible_join_keys,
+                &possible_join_keys,

Review Comment:
   `find_inner_join` does not modify `possible_join_keys` so update the 
signature to make that clear



##########
datafusion/optimizer/src/eliminate_cross_join.rs:
##########
@@ -184,27 +183,39 @@ fn try_flatten_join_inputs(
                     return Ok(false);
                 }
             }
-            _ => all_inputs.push((*child).clone()),
+            _ => all_inputs.push(child.clone()),
         }
     }
     Ok(true)
 }
 
+/// Finds the next to join with the left input plan,

Review Comment:
   I spent some time studying this code so wanted to document what it is doing



-- 
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-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to