You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/15 14:25:01 UTC
[GitHub] [arrow] bkietz commented on a diff in pull request #14415: ARROW-17966: [C++] Adjust to new format for Substrait optional arguments
bkietz commented on code in PR #14415:
URL: https://github.com/apache/arrow/pull/14415#discussion_r1022848852
##########
cpp/src/arrow/engine/substrait/expression_internal.cc:
##########
@@ -80,15 +69,31 @@ Status DecodeArg(const substrait::FunctionArgument& arg, uint32_t idx,
return Status::OK();
}
+Status DecodeOption(const substrait::FunctionOption& opt, SubstraitCall* call) {
+ std::vector<std::string_view> prefs;
+ if (opt.preference_size() == 0) {
+ return Status::Invalid("Invalid Substrait plan. The option ", opt.name(),
+ " is specified but does not list any choices");
+ }
+ for (const auto& preference : opt.preference()) {
+ prefs.push_back(preference);
+ }
+ call->SetOption(opt.name(), prefs);
Review Comment:
```suggestion
call->SetOption(opt.name(), std::move(prefs));
```
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org