kumarUjjawal commented on code in PR #25521:
URL: https://github.com/apache/datafusion/pull/25521#discussion_r4056168156
##########
datafusion/sql/src/unparser/plan.rs:
##########
@@ -593,10 +593,37 @@ impl Unparser<'_> {
alias: Option<ast::TableAlias>,
lateral: bool,
) -> Result<()> {
+ let preserve_names = matches!(plan, LogicalPlan::Projection(_))
Review Comment:
Output-name preservation should not depend on the derived table having a
table alias. BigQueryDialect does not require one, so
`derive_with_dialect_alias` passes `None` and this condition remains false. The
inner computed expression is then anonymous while the outer projection
references its encoded logical name, producing invalid GoogleSQL. Could we
preserve names whenever no table-column alias list already provides them, and
add a BigQuery or alias-less regression test?
--
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]