peasee commented on code in PR #13405:
URL: https://github.com/apache/datafusion/pull/13405#discussion_r1845682157


##########
datafusion/sql/src/unparser/rewrite.rs:
##########
@@ -363,3 +363,138 @@ impl TreeNodeRewriter for TableAliasRewriter<'_> {
         }
     }
 }
+
+/// Takes an input list of identifiers and a list of identifiers that are 
available from relations or joins.
+/// Removes any table identifiers that are not present in the list of 
available identifiers, retains original column names.
+pub fn remove_dangling_identifiers(idents: &mut Vec<Ident>, available_idents: 
&[String]) {

Review Comment:
   Yeah, I had taken a look into doing this at the unparser `LogicalPlan` level 
but I wasn't making very good progress. It could be my lack of understanding 
with `LogicalPlan`, but I think the symptom originates from the parser rather 
than the unparser.
   
   If you'd be open to merging this still as an AST modifier, perhaps we could 
gate it behind a dialect option or feature flag as a non-default?



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