File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
datafusion/sql/src/unparser Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,18 @@ impl Unparser<'_> {
181
181
negated : insubq. negated ,
182
182
} )
183
183
}
184
+ Expr :: IsNotNull ( expr) => {
185
+ Ok ( ast:: Expr :: IsNotNull ( Box :: new ( self . expr_to_sql ( expr) ?) ) )
186
+ }
187
+ Expr :: IsTrue ( expr) => {
188
+ Ok ( ast:: Expr :: IsTrue ( Box :: new ( self . expr_to_sql ( expr) ?) ) )
189
+ }
190
+ Expr :: IsFalse ( expr) => {
191
+ Ok ( ast:: Expr :: IsFalse ( Box :: new ( self . expr_to_sql ( expr) ?) ) )
192
+ }
193
+ Expr :: IsUnknown ( expr) => {
194
+ Ok ( ast:: Expr :: IsUnknown ( Box :: new ( self . expr_to_sql ( expr) ?) ) )
195
+ }
184
196
_ => not_impl_err ! ( "Unsupported expression: {expr:?}" ) ,
185
197
}
186
198
}
@@ -599,6 +611,19 @@ mod tests {
599
611
} ) ,
600
612
"COUNT(DISTINCT *)" ,
601
613
) ,
614
+ ( Expr :: IsNotNull ( Box :: new( col( "a" ) ) ) , r#""a" IS NOT NULL"# ) ,
615
+ (
616
+ Expr :: IsTrue ( Box :: new( ( col( "a" ) + col( "b" ) ) . gt( lit( 4 ) ) ) ) ,
617
+ r#"(("a" + "b") > 4) IS TRUE"# ,
618
+ ) ,
619
+ (
620
+ Expr :: IsFalse ( Box :: new( ( col( "a" ) + col( "b" ) ) . gt( lit( 4 ) ) ) ) ,
621
+ r#"(("a" + "b") > 4) IS FALSE"# ,
622
+ ) ,
623
+ (
624
+ Expr :: IsUnknown ( Box :: new( ( col( "a" ) + col( "b" ) ) . gt( lit( 4 ) ) ) ) ,
625
+ r#"(("a" + "b") > 4) IS UNKNOWN"# ,
626
+ ) ,
602
627
] ;
603
628
604
629
for ( expr, expected) in tests {
You can’t perform that action at this time.
0 commit comments