@@ -417,9 +417,7 @@ impl Unparser<'_> {
417417 Expr :: Placeholder ( p) => {
418418 Ok ( ast:: Expr :: Value ( ast:: Value :: Placeholder ( p. id . to_string ( ) ) ) )
419419 }
420- Expr :: OuterReferenceColumn ( _, _) => {
421- not_impl_err ! ( "Unsupported Expr conversion: {expr:?}" )
422- }
420+ Expr :: OuterReferenceColumn ( _, col) => self . col_to_sql ( col) ,
423421 Expr :: Unnest ( _) => not_impl_err ! ( "Unsupported Expr conversion: {expr:?}" ) ,
424422 }
425423 }
@@ -874,9 +872,9 @@ mod tests {
874872 use datafusion_expr:: {
875873 case, col, exists,
876874 expr:: { AggregateFunction , AggregateFunctionDefinition } ,
877- lit, not, not_exists, placeholder, table_scan, try_cast, when, wildcard ,
878- ColumnarValue , ScalarUDF , ScalarUDFImpl , Signature , Volatility , WindowFrame ,
879- WindowFunctionDefinition ,
875+ lit, not, not_exists, out_ref_col , placeholder, table_scan, try_cast, when,
876+ wildcard , ColumnarValue , ScalarUDF , ScalarUDFImpl , Signature , Volatility ,
877+ WindowFrame , WindowFunctionDefinition ,
880878 } ;
881879
882880 use crate :: unparser:: dialect:: CustomDialect ;
@@ -1161,6 +1159,10 @@ mod tests {
11611159 r#"TRY_CAST("a" AS INTEGER UNSIGNED)"# ,
11621160 ) ,
11631161 ( col( "x" ) . eq( placeholder( "$1" ) ) , r#"("x" = $1)"# ) ,
1162+ (
1163+ out_ref_col( DataType :: Int32 , "t.a" ) . gt( lit( 1 ) ) ,
1164+ r#"("t"."a" > 1)"# ,
1165+ ) ,
11641166 ] ;
11651167
11661168 for ( expr, expected) in tests {
0 commit comments