alexanderbianchi commented on code in PR #27099:
URL: https://github.com/apache/datafusion/pull/27099#discussion_r4495659109
##########
datafusion/substrait/src/logical_plan/consumer/expr/scalar_function.rs:
##########
@@ -30,7 +31,13 @@ pub async fn from_scalar_function(
};
let fn_name = substrait_fun_name(fn_signature);
- let args = from_substrait_func_args(consumer, &f.arguments,
input_schema).await?;
+ let mut args = from_substrait_func_args(consumer, &f.arguments,
input_schema).await?;
Review Comment:
Should we restrict this to arguments that actually need a common type? This
runs for every scalar function, including `named_struct` and arbitrary UDFs.
For example, in `named_struct('left', s, 'right', <struct literal>)`, the two
struct values are independent, but this would rename the literal’s fields to
match `s` whenever their shapes match. That could change the resulting schema
and break subsequent named field access. Could we add a regression test
covering independent struct arguments?
##########
datafusion/substrait/src/logical_plan/consumer/expr/scalar_function.rs:
##########
@@ -30,7 +31,13 @@ pub async fn from_scalar_function(
};
let fn_name = substrait_fun_name(fn_signature);
- let args = from_substrait_func_args(consumer, &f.arguments,
input_schema).await?;
+ let mut args = from_substrait_func_args(consumer, &f.arguments,
input_schema).await?;
Review Comment:
Should we restrict this to arguments that actually need a common type? This
runs for every scalar function, including `named_struct` and arbitrary UDFs.
For example, in `named_struct('left', s, 'right', <struct literal>)`, the two
struct values are independent, but this would rename the literal’s fields to
match `s` whenever their shapes match. That could change the resulting schema
and break subsequent named field access.
--
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]