goldmedal commented on code in PR #15693:
URL: https://github.com/apache/datafusion/pull/15693#discussion_r2044495904


##########
datafusion/sql/src/unparser/plan.rs:
##########
@@ -582,6 +582,7 @@ impl Unparser<'_> {
                     }
                     _ => (&join.left, &join.right),
                 };
+                let already_projected = select.already_projected();

Review Comment:
   Could you add a comment explaining why we get `already_projected` before the 
rewriting for left_plan?



##########
datafusion/sql/src/unparser/plan.rs:
##########
@@ -719,6 +737,14 @@ impl Unparser<'_> {
                         let mut from = select.pop_from().unwrap();
                         from.push_join(ast_join);
                         select.push_from(from);
+                        if !already_projected {
+                            let projection = left_projection
+                                .unwrap()

Review Comment:
   ```suggestion
                               let Some(left_projection) = left_projection else 
{
                                   return internal_err!("Left projection is 
missing");
                               };
                               let projection = left_projection
   ```



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