comphead commented on code in PR #1132:
URL: https://github.com/apache/datafusion-comet/pull/1132#discussion_r1866677073


##########
native/core/src/execution/datafusion/planner.rs:
##########
@@ -1230,21 +1230,20 @@ impl PhysicalPlanner {
                         )),
                     ))
                 } else {
-                    // we insert a projection around the hash join in this case
-                    let projection =
+                    let swapped_hash_join =
                         swap_hash_join(hash_join.as_ref(), 
PartitionMode::Partitioned)?;
-                    let swapped_hash_join = 
Arc::clone(projection.children()[0]);
-                    let mut additional_native_plans = swapped_hash_join
-                        .children()
-                        .iter()
-                        .map(|p| Arc::clone(p))
-                        .collect::<Vec<_>>();
-                    
additional_native_plans.push(Arc::clone(&swapped_hash_join));
+
+                    let mut additional_native_plans = vec![];
+                    if swapped_hash_join.as_any().is::<ProjectionExec>() {
+                        // a projection was added to the hash join
+                        
additional_native_plans.push(Arc::clone(swapped_hash_join.children()[0]));

Review Comment:
   I suppose there is no chance of having `children` empty? 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to