Xuanwo commented on code in PR #23830:
URL: https://github.com/apache/datafusion/pull/23830#discussion_r3943217335


##########
datafusion/sql/src/unparser/plan.rs:
##########
@@ -1917,6 +1917,126 @@ impl Unparser<'_> {
         }
     }
 
+    // Keep ASOF-specific locals out of the recursive plan unparser's stack 
frame.
+    #[inline(never)]
+    fn asof_join_to_sql(
+        &self,
+        join: &AsOfJoin,
+        query: &mut Option<QueryBuilder>,
+        select: &mut SelectBuilder,
+        relation: &mut RelationBuilder,
+    ) -> Result<()> {
+        let already_projected = select.already_projected();
+        let left_plan =
+            
Self::unwrap_qualified_passthrough_join_projection(Arc::clone(&join.left));
+        let inline_left_join = matches!(left_plan.as_ref(), 
LogicalPlan::Join(_));

Review Comment:
   Yes, good catch. I added AsOfJoin here.
   



##########
datafusion/sql/src/unparser/plan.rs:
##########
@@ -2235,26 +2423,28 @@ impl Unparser<'_> {
         }
     }
 
-    fn qualified_passthrough_join_projection_to_nested_relation(
+    fn join_input_to_nested_relation(
         &self,
         plan: &LogicalPlan,
         query: &mut Option<QueryBuilder>,
     ) -> Result<Option<RelationBuilder>> {
-        let LogicalPlan::Projection(projection) = plan else {
-            return Ok(None);
+        let join_plan = match plan {
+            LogicalPlan::Join(_) => plan,
+            LogicalPlan::Projection(projection)

Review Comment:
   updated.



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