File tree 2 files changed +18
-2
lines changed
datafusion/sql/src/unparser
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ pub struct DefaultDialect {}
26
26
27
27
impl Dialect for DefaultDialect {
28
28
fn identifier_quote_style ( & self ) -> Option < char > {
29
- None
29
+ Some ( '"' )
30
30
}
31
31
}
32
32
Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ impl Unparser<'_> {
358
358
pub ( super ) fn new_ident ( & self , str : String ) -> ast:: Ident {
359
359
ast:: Ident {
360
360
value : str,
361
- quote_style : Some ( self . dialect . identifier_quote_style ( ) . unwrap_or ( '"' ) ) ,
361
+ quote_style : self . dialect . identifier_quote_style ( ) ,
362
362
}
363
363
}
364
364
@@ -965,4 +965,20 @@ mod tests {
965
965
966
966
Ok ( ( ) )
967
967
}
968
+
969
+ #[ test]
970
+ fn custom_dialect_none ( ) -> Result < ( ) > {
971
+ let dialect = CustomDialect :: new ( None ) ;
972
+ let unparser = Unparser :: new ( & dialect) ;
973
+
974
+ let expr = col ( "a" ) . gt ( lit ( 4 ) ) ;
975
+ let ast = unparser. expr_to_sql ( & expr) ?;
976
+
977
+ let actual = format ! ( "{}" , ast) ;
978
+
979
+ let expected = r#"(a > 4)"# ;
980
+ assert_eq ! ( actual, expected) ;
981
+
982
+ Ok ( ( ) )
983
+ }
968
984
}
You can’t perform that action at this time.
0 commit comments