westonpace commented on code in PR #13032:
URL: https://github.com/apache/arrow/pull/13032#discussion_r862108441
##########
cpp/src/arrow/engine/substrait/expression_internal.cc:
##########
@@ -165,7 +165,15 @@ Result<compute::Expression> FromProto(const
substrait::Expression& expr,
ARROW_ASSIGN_OR_RAISE(arguments[i], FromProto(scalar_fn.args(i),
ext_set));
}
- return compute::call(decoded_function.name.to_string(),
std::move(arguments));
+ auto func_name = decoded_function.name.to_string();
+ if (func_name != "cast") {
+ return compute::call(func_name, std::move(arguments));
+ } else {
+ ARROW_ASSIGN_OR_RAISE(auto output_type_desc,
+ FromProto(scalar_fn.output_type(), ext_set));
+ auto cast_options = compute::CastOptions::Safe(output_type_desc.first);
+ return compute::call(func_name, std::move(arguments), cast_options);
Review Comment:
```suggestion
auto cast_options =
compute::CastOptions::Safe(std::move(output_type_desc.first));
return compute::call(func_name, std::move(arguments),
std::move(cast_options));
```
--
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]