westonpace commented on code in PR #13468:
URL: https://github.com/apache/arrow/pull/13468#discussion_r913972694
##########
cpp/src/arrow/engine/substrait/expression_internal.cc:
##########
@@ -160,9 +160,18 @@ Result<compute::Expression> FromProto(const
substrait::Expression& expr,
ARROW_ASSIGN_OR_RAISE(auto decoded_function,
ext_set.DecodeFunction(scalar_fn.function_reference()));
- std::vector<compute::Expression> arguments(scalar_fn.args_size());
- for (int i = 0; i < scalar_fn.args_size(); ++i) {
- ARROW_ASSIGN_OR_RAISE(arguments[i], FromProto(scalar_fn.args(i),
ext_set));
+ std::vector<compute::Expression> arguments(scalar_fn.arguments_size());
+ for (int i = 0; i < scalar_fn.arguments_size(); ++i) {
+ const auto& argument = scalar_fn.arguments(i);
+ switch (argument.arg_type_case()) {
+ case substrait::FunctionArgument::kValue: {
+ ARROW_ASSIGN_OR_RAISE(arguments[i], FromProto(argument.value(),
ext_set));
+ break;
+ }
+ default:
+ return Status::NotImplemented(
+ "only value arguments are currently supported for functions");
Review Comment:
Minor nit: If possible, it might be nice to include the string value of what
was specified? E.g. "Only `value` is supported but got "enum". But I don't
remember if it is easy to go from `arg_type_case` to a string.
--
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]