Skip to content
Merged
3 changes: 3 additions & 0 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ jobs:
# pkg-config formula is removed from GitHub Actions runner.
brew uninstall pkg-config || :
brew uninstall pkg-config@0.29.2 || :
# Workaround for https://github.com/grpc/grpc/issues/41755
# Remove once the runner ships a newer Homebrew.
brew update
brew bundle --file=cpp/Brewfile
- name: Install MinIO
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ jobs:
# pkg-config formula is removed from GitHub Actions runner.
brew uninstall pkg-config || :
brew uninstall pkg-config@0.29.2 || :
# Workaround for https://github.com/grpc/grpc/issues/41755
# Remove once the runner ships a newer Homebrew.
brew update
brew bundle --file=cpp/Brewfile
python -m pip install \
-r python/requirements-build.txt \
-r python/requirements-test.txt
Expand Down
6 changes: 6 additions & 0 deletions cpp/src/arrow/engine/substrait/expression_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,13 @@ struct ScalarToProtoImpl {
auto user_defined = std::make_unique<Lit::UserDefined>();
user_defined->set_type_reference(anchor);
auto value_any = std::make_unique<google::protobuf::Any>();
#if PROTOBUF_VERSION >= 3015000
if (!value_any->PackFrom(value)) {
return Status::IOError("Failed to pack user-defined type value");
}
#else
value_any->PackFrom(value);
#endif
user_defined->set_allocated_value(value_any.release());
lit_->set_allocated_user_defined(user_defined.release());
return Status::OK();
Expand Down
12 changes: 9 additions & 3 deletions cpp/src/arrow/engine/substrait/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,23 @@ class DefaultExtensionProvider : public BaseExtensionProvider {
const ExtensionSet& ext_set) override {
if (rel.Is<substrait_ext::AsOfJoinRel>()) {
substrait_ext::AsOfJoinRel as_of_join_rel;
rel.UnpackTo(&as_of_join_rel);
if (!rel.UnpackTo(&as_of_join_rel)) {
return Status::IOError("Failed to unpack AsOfJoinRel");
}
return MakeAsOfJoinRel(inputs, as_of_join_rel, ext_set);
}
if (rel.Is<substrait_ext::NamedTapRel>()) {
substrait_ext::NamedTapRel named_tap_rel;
rel.UnpackTo(&named_tap_rel);
if (!rel.UnpackTo(&named_tap_rel)) {
return Status::IOError("Failed to unpack NamedTapRel");
}
return MakeNamedTapRel(conv_opts, inputs, named_tap_rel, ext_set);
}
if (rel.Is<substrait_ext::SegmentedAggregateRel>()) {
substrait_ext::SegmentedAggregateRel seg_agg_rel;
rel.UnpackTo(&seg_agg_rel);
if (!rel.UnpackTo(&seg_agg_rel)) {
return Status::IOError("Failed to unpack SegmentedAggregateRel");
}
return MakeSegmentedAggregateRel(conv_opts, inputs, seg_agg_rel, ext_set);
}
return Status::NotImplemented("Unrecognized extension in Substrait plan: ",
Expand Down
6 changes: 6 additions & 0 deletions cpp/src/arrow/flight/sql/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,13 @@ arrow::Result<std::string> CreateStatementQueryTicket(
ticket_statement_query.set_statement_handle(statement_handle);

google::protobuf::Any ticket;
#if PROTOBUF_VERSION >= 3015000
if (!ticket.PackFrom(ticket_statement_query)) {
return Status::IOError("Failed to pack ticket");
}
#else
ticket.PackFrom(ticket_statement_query);
#endif

std::string ticket_string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,10 @@ ::grpc::Status FlightDataDeserialize(ByteBuffer* buffer,
// Can't use ParseFromCodedStream as this reads the entire
// rest of the stream into the descriptor command field.
std::string buffer;
pb_stream.ReadString(&buffer, length);
if (!pb_stream.ReadString(&buffer, length)) {
return {::grpc::StatusCode::INTERNAL,
"Unable to read FlightDescriptor from protobuf"};
}
if (!pb_descriptor.ParseFromString(buffer)) {
return {::grpc::StatusCode::INTERNAL, "Unable to parse FlightDescriptor"};
}
Expand Down
Loading