Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-45807: [C++] compatibility patches for protobuf 30 #45805

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpp/src/arrow/engine/substrait/expression_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ std::string EnumToString(int value, const google::protobuf::EnumDescriptor* desc
if (value_desc == nullptr) {
return "unknown";
}
return value_desc->name();
return std::string(value_desc->name());
}

Result<compute::Expression> FromProto(const substrait::Expression::ReferenceSegment* ref,
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/engine/substrait/serde.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ Status ParseFromBufferImpl(const Buffer& buf, const std::string& full_name,
template <typename Message>
Result<Message> ParseFromBuffer(const Buffer& buf) {
Message message;
ARROW_RETURN_NOT_OK(
ParseFromBufferImpl(buf, Message::descriptor()->full_name(), &message));
ARROW_RETURN_NOT_OK(ParseFromBufferImpl(
buf, std::string(Message::descriptor()->full_name()), &message));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead we can change the ParseFromBufferImpl signature to take a string_view

return message;
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/engine/substrait/util_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ std::string EnumToString(int value, const google::protobuf::EnumDescriptor& desc
if (value_desc == nullptr) {
return "unknown";
}
return value_desc->name();
return std::string(value_desc->name());
}

std::unique_ptr<substrait::Version> CreateVersion() {
Expand Down
Loading