Skip to content

Commit 52edec6

Browse files
committed
fix: allow Utf8View as valid second argument for arrow_cast
1 parent 61ed6a2 commit 52edec6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

datafusion/functions/src/core/arrow_cast.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ fn data_type_from_args(args: &[Expr]) -> Result<DataType> {
173173
if args.len() != 2 {
174174
return plan_err!("arrow_cast needs 2 arguments, {} provided", args.len());
175175
}
176-
let Expr::Literal(ScalarValue::Utf8(Some(val))) | Expr::Literal(ScalarValue::Utf8View(Some(val))) = &args[1] else {
176+
let (Expr::Literal(ScalarValue::Utf8(Some(val)))
177+
| Expr::Literal(ScalarValue::Utf8View(Some(val)))) = &args[1]
178+
else {
177179
return plan_err!(
178180
"arrow_cast requires its second argument to be a constant string, got {:?}",
179181
&args[1]

0 commit comments

Comments
 (0)