Skip to content

Commit e635e05

Browse files
raulcdassignUser
authored andcommitted
GH-46134: [CI][C++] Explicit conversion of possible absl::string_view on protobuf methods to std::string (#46136)
### Rationale for this change Protobuf v30.2 uses `absl::string_view` instead of `const char*` as seen here: protocolbuffers/protobuf@a9ad51f This is breaking on our CI. ### What changes are included in this PR? Explicitly convert `google::protobuf::EnumValueDescriptor::name()` and `google::protobuf::Message::descriptor()->full_name()` from `absl::string_view` to `std::string` ### Are these changes tested? Via CI, MinGW CI jobs use protobuf v30.2 and those are fixed with this change. ### Are there any user-facing changes? No * GitHub Issue: #46134 Authored-by: Raúl Cumplido <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 71a2a29 commit e635e05

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cpp/src/arrow/engine/substrait/expression_internal.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ std::string EnumToString(int value, const google::protobuf::EnumDescriptor* desc
142142
if (value_desc == nullptr) {
143143
return "unknown";
144144
}
145-
return value_desc->name();
145+
return std::string(value_desc->name());
146146
}
147147

148148
Result<compute::Expression> FromProto(const substrait::Expression::ReferenceSegment* ref,

cpp/src/arrow/engine/substrait/serde.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ Status ParseFromBufferImpl(const Buffer& buf, const std::string& full_name,
6262
template <typename Message>
6363
Result<Message> ParseFromBuffer(const Buffer& buf) {
6464
Message message;
65-
ARROW_RETURN_NOT_OK(
66-
ParseFromBufferImpl(buf, Message::descriptor()->full_name(), &message));
65+
ARROW_RETURN_NOT_OK(ParseFromBufferImpl(
66+
buf, std::string(Message::descriptor()->full_name()), &message));
6767
return message;
6868
}
6969

cpp/src/arrow/engine/substrait/util_internal.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ std::string EnumToString(int value, const google::protobuf::EnumDescriptor& desc
3030
if (value_desc == nullptr) {
3131
return "unknown";
3232
}
33-
return value_desc->name();
33+
return std::string(value_desc->name());
3434
}
3535

3636
std::unique_ptr<substrait::Version> CreateVersion() {

0 commit comments

Comments
 (0)