jorgecarleitao commented on a change in pull request #7967:
URL: https://github.com/apache/arrow/pull/7967#discussion_r483427788
##########
File path: rust/datafusion/src/sql/planner.rs
##########
@@ -524,25 +524,18 @@ impl<'a, S: SchemaProvider> SqlToRel<'a, S> {
args: rex_args,
})
}
- // finally, built-in scalar functions
+ // finally, user-defined functions
_ => match self.schema_provider.get_function_meta(&name) {
Some(fm) => {
- let rex_args = function
+ let args = function
.args
.iter()
.map(|a| self.sql_to_rex(a, schema))
.collect::<Result<Vec<Expr>>>()?;
- let mut safe_args: Vec<Expr> = vec![];
Review comment:
the sql planner no longer needs to add casts based on the function's
signature. This was causing statements such as `SELECT my_sqrt(c1) FROM t` to
be logically planned as `SELECT my_sqrt(CAST(c1 AS f64)) FROM t`, which is
counter-intuitive when reading the result.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]