rtpsw commented on code in PR #14485:
URL: https://github.com/apache/arrow/pull/14485#discussion_r1032887495
##########
cpp/src/arrow/engine/substrait/expression_internal.cc:
##########
@@ -926,16 +941,12 @@
Result<std::unique_ptr<substrait::Expression::ScalarFunction>> EncodeSubstraitCa
ToProto(*call.output_type(), call.output_nullable(), ext_set,
conversion_options));
scalar_fn->set_allocated_output_type(output_type.release());
- for (uint32_t i = 0; i < call.size(); i++) {
+ for (int i = 0; i < call.size(); i++) {
substrait::FunctionArgument* arg = scalar_fn->add_arguments();
if (call.HasEnumArg(i)) {
auto enum_val = std::make_unique<substrait::FunctionArgument::Enum>();
- ARROW_ASSIGN_OR_RAISE(std::optional<std::string_view> enum_arg,
call.GetEnumArg(i));
- if (enum_arg) {
- enum_val->set_specified(std::string(*enum_arg));
- } else {
- enum_val->set_allocated_unspecified(new google::protobuf::Empty());
- }
+ ARROW_ASSIGN_OR_RAISE(std::string_view enum_arg, call.GetEnumArg(i));
+ enum_val->set_specified(std::string(enum_arg));
Review Comment:
Merge seems OK.
--
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]