Skip to content

Commit

Permalink
fix udf
Browse files Browse the repository at this point in the history
Signed-off-by: Runji Wang <[email protected]>
  • Loading branch information
wangrunji0408 committed Dec 23, 2024
1 parent cc9eb48 commit 0c96ab9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/binder/create_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ impl Binder {
// and double dollar (i.e., as $$select $1 + $2$$) for as clause
let body = match function_body {
Some(CreateFunctionBody::AsBeforeOptions(expr))
| Some(CreateFunctionBody::AsAfterOptions(expr)) => expr.to_string(),
| Some(CreateFunctionBody::AsAfterOptions(expr)) => match expr {
Expr::Value(Value::SingleQuotedString(s)) => s,
Expr::Value(Value::DollarQuotedString(s)) => s.value,
_ => return Err(BindError::BindFunctionError("expected string".into())),
},
Some(CreateFunctionBody::Return(return_expr)) => {
// Note: this is a current work around, and we are assuming return sql udf
// will NOT involve complex syntax, so just reuse the logic for select definition
Expand Down

0 comments on commit 0c96ab9

Please sign in to comment.