pitrou commented on a change in pull request #12448:
URL: https://github.com/apache/arrow/pull/12448#discussion_r809101654
##########
File path: cpp/src/arrow/engine/substrait/expression_internal.cc
##########
@@ -443,8 +443,11 @@ struct ScalarToProtoImpl {
return Status::OK();
}
+ // Note: while std::string&& would be better for the argument
+ // type, older versions of protobuf don't have this overload
+ // yet.
template <typename ScalarWithBufferValue>
- Status FromBuffer(void (substrait::Expression::Literal::*set)(std::string&&),
+ Status FromBuffer(void (substrait::Expression::Literal::*set)(const
std::string&),
Review comment:
If the lambda is too ugly, we can also remove the `FromBuffer` helpers,
which will add at most one line of code to each caller. In both cases the
bottom line is that we don't hardcode the actual protobuf method signature, so
we're more robust against signature changes.
##########
File path: cpp/src/arrow/engine/substrait/expression_internal.cc
##########
@@ -443,8 +443,11 @@ struct ScalarToProtoImpl {
return Status::OK();
}
+ // Note: while std::string&& would be better for the argument
+ // type, older versions of protobuf don't have this overload
+ // yet.
template <typename ScalarWithBufferValue>
- Status FromBuffer(void (substrait::Expression::Literal::*set)(std::string&&),
+ Status FromBuffer(void (substrait::Expression::Literal::*set)(const
std::string&),
Review comment:
If the lambda is too ugly, we can also remove the `FromBuffer` helper,
which will add at most one line of code to each caller. In both cases the
bottom line is that we don't hardcode the actual protobuf method signature, so
we're more robust against signature changes.
--
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]