This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/main by this push:
new ddc025818 ORC-1974: [C++] Use `google::protobuf::TextFormat` instead
of `DebugString` for `Protobuf` v30+
ddc025818 is described below
commit ddc0258188968b3e34644a00304528be00fc9099
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Fri Aug 15 13:51:46 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`.
There was a related report here.
- https://github.com/apache/orc/issues/2239
### How was this patch tested?
Pass the CIs.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #2358 from dongjoon-hyun/ORC-1974.
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,