wackywendell commented on code in PR #11636:
URL: https://github.com/apache/datafusion/pull/11636#discussion_r1690138973
##########
datafusion/sql/src/unparser/plan.rs:
##########
@@ -582,9 +558,89 @@ impl Unparser<'_> {
}
}
+ /// Convert the components of a USING clause to the USING AST
+ fn join_using_to_sql(
+ &self,
+ join_conditions: &[(Expr, Expr)],
+ ) -> Result<ast::JoinConstraint> {
+ let mut idents = Vec::with_capacity(join_conditions.len());
+ for (left, right) in join_conditions {
+ match (left, right) {
+ (
+ Expr::Column(Column {
+ relation: _,
+ name: left_name,
+ }),
+ Expr::Column(Column {
+ relation: _,
+ name: right_name,
+ }),
+ ) => {
+ if left_name != right_name {
+ // USING is only valid when the column names are the
+ // same, so they should never be different
+ return not_impl_err!(
+ "Unsupported USING with different column names"
+ );
Review Comment:
That can happen with `ON`, but it can't happen with `USING`, right? This
function is only for `USING`.
--
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]