This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 39a7b6d19 ORC-1974: [C++] Use `google::protobuf::TextFormat` instead
of `DebugString` for `Protobuf` v30+
39a7b6d19 is described below
commit 39a7b6d199cd3fd12c66c3c6ff250fb0d3fe9929
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Fri Sep 12 12:56:43 2025 -0700
ORC-1974: [C++] Use `google::protobuf::TextFormat` instead of `DebugString`
for `Protobuf` v30+
### What changes were proposed in this pull request?
This PR aims to use `google::protobuf::TextFormat` instead of `DebugString`
for Protobuf v30+.
- https://github.com/protocolbuffers/protobuf/releases/tag/v30.0
> Make DebugString print debug output, enable debug markers for debug
output
### Why are the changes needed?
Otherwise, our C++ `orc-metadata` tool will have a regression to expose the
debug marker string, `goo.gle/debugstr`.
Currently, `branch-2.0` CI is broken on `MacOS` due to this.
- https://github.com/apache/orc/actions/runs/17683726166/job/50263664096
> +goo.gle/debugonly
### How was this patch tested?
Pass the CIs.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #2390 from dongjoon-hyun/ORC-1974-2.0.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
tools/src/FileMetadata.cc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/src/FileMetadata.cc b/tools/src/FileMetadata.cc
index 94b4a678d..afc46edfe 100644
--- a/tools/src/FileMetadata.cc
+++ b/tools/src/FileMetadata.cc
@@ -28,6 +28,7 @@
// #include "Adaptor.hh"
#include "wrap/orc-proto-wrapper.hh"
+#include <google/protobuf/text_format.h>
void printStripeInformation(std::ostream& out, uint64_t index, uint64_t
columns,
std::unique_ptr<orc::StripeInformation> stripe,
bool verbose) {
@@ -82,7 +83,10 @@ void printRawTail(std::ostream& out, const char* filename) {
if (!tail.ParseFromString(reader->getSerializedFileTail())) {
throw orc::ParseError("Failed to parse the file tail from string");
}
- out << tail.DebugString();
+ google::protobuf::TextFormat::Printer printer;
+ std::string text_output;
+ printer.PrintToString(tail, &text_output);
+ out << text_output;
}
void printAttributes(std::ostream& out, const orc::Type& type, const
std::string& name,