Skip to content

Commit

Permalink
ORC-1128: [C++] Replace protobuf::MessageLite::ByteSize() with ByteSi…
Browse files Browse the repository at this point in the history
…zeLong()

This fixes #1065
  • Loading branch information
wzhou-code authored Mar 17, 2022
1 parent 9d45c92 commit ffbd341
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions c++/test/CreateTestFiles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ void writeCustomOrcFile(const std::string& filename,
exit(1);
}
orc::proto::PostScript ps;
ps.set_footerlength(static_cast<uint64_t>(footer.ByteSize()));
ps.set_footerlength(static_cast<uint64_t>(footer.ByteSizeLong()));
ps.set_compression(orc::proto::NONE);
ps.set_compressionblocksize(64*1024);
for(size_t i=0; i < version.size(); ++i) {
ps.add_version(version[i]);
}
ps.set_metadatalength(static_cast<uint64_t>(metadata.ByteSize()));
ps.set_metadatalength(static_cast<uint64_t>(metadata.ByteSizeLong()));
ps.set_writerversion(writerVersion);
ps.set_magic("ORC");
if (!ps.SerializeToOstream(&output)) {
std::cerr << "Failed to write postscript for " << filename << "\n";
exit(1);
}
output.put(static_cast<char>(ps.ByteSize()));
output.put(static_cast<char>(ps.ByteSizeLong()));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion c++/test/TestBufferedOutputStream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace orc {

EXPECT_TRUE(ps.SerializeToZeroCopyStream(&bufStream));
bufStream.flush();
EXPECT_EQ(ps.ByteSize(), memStream.getLength());
EXPECT_EQ(ps.ByteSizeLong(), memStream.getLength());

proto::PostScript ps2;
ps2.ParseFromArray(
Expand Down

0 comments on commit ffbd341

Please sign in to comment.