jcsherin commented on code in PR #13462:
URL: https://github.com/apache/datafusion/pull/13462#discussion_r1846457841
##########
datafusion/sql/src/unparser/expr.rs:
##########
@@ -2500,4 +2498,43 @@ mod tests {
}
Ok(())
}
+
+ #[test]
+ fn test_utf8_view_to_sql() -> Result<()> {
+ let dialect = CustomDialectBuilder::new()
+ .with_utf8_cast_dtype(ast::DataType::Char(None))
+ .build();
+ let unparser = Unparser::new(&dialect);
+
+ let ast_dtype =
unparser.arrow_dtype_to_ast_dtype(&DataType::Utf8View)?;
+
+ assert_eq!(ast_dtype, ast::DataType::Char(None));
+
+ let expr = Expr::Cast(Cast {
+ expr: Box::new(col("a")),
+ data_type: DataType::Utf8View,
+ });
Review Comment:
```suggestion
let expr = cast(col("a"), DataType::Utf8View);
```
--
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]