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


##########
datafusion/sql/src/unparser/plan.rs:
##########
@@ -377,8 +377,17 @@ impl Unparser<'_> {
                 };
                 if self.dialect.unnest_as_table_factor() && 
unnest_input_type.is_some() {
                     if let LogicalPlan::Unnest(unnest) = &p.input.as_ref() {
-                        return self
-                            .unnest_to_table_factor_sql(unnest, query, select, 
relation);
+                        if let LogicalPlan::Projection(projection) = 
unnest.input.as_ref()
+                        {
+                            if matches!(
+                                projection.input.as_ref(),
+                                LogicalPlan::EmptyRelation(_)

Review Comment:
   It's better to add some comments to explain why we match `EmptyRelation`.



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