phillipleblanc opened a new issue, #10197:
URL: https://github.com/apache/datafusion/issues/10197
### 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
```rust
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
```rust
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_
--
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]