rtpsw commented on code in PR #13468:
URL: https://github.com/apache/arrow/pull/13468#discussion_r914047237
##########
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:
:ate to the party, but in case it helps, I see there is
[EnumDescriptor](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.descriptor#EnumDescriptor).
--
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]