-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I'm using the Unparser.expr_to_sql function to translate a DataFusion Expr into an expression for Spark Connect. Unlike most SQL engines, Spark doesn't like quoting the column identifiers. I want to be able to generate an expression like a > 4 but currently I can only get "a" > 4
I believe this might be useful beyond Spark for other database systems that can handle unquoted column identifiers.
To Reproduce
use datafusion_expr::{col, lit};
use datafusion_sql::unparser::Unparser;
let expr = col("a").gt(lit(4));
let spark_dialect = CustomDialect::new(None);
let unparser = Unparser::new(&spark_dialect);
let sql = unparser.expr_to_sql(&expr).unwrap();
assert_eq!(format!("{}", sql), "(\"a\" > 4)")Expected behavior
use datafusion_expr::{col, lit};
use datafusion_sql::unparser::Unparser;
let expr = col("a").gt(lit(4));
let spark_dialect = CustomDialect::new(None);
let unparser = Unparser::new(&spark_dialect);
let sql = unparser.expr_to_sql(&expr).unwrap();
assert_eq!(format!("{}", sql), "(a > 4)")Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working