Skip to content

Commit

Permalink
[GH-42102] Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alkis committed Jul 22, 2024
1 parent ec58e4d commit 6dd46cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cpp/tools/parquet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if(PARQUET_BUILD_EXECUTABLES)
install(TARGETS ${TOOL} ${INSTALL_IS_OPTIONAL}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endforeach(TOOL)
target_link_libraries(parquet-dump-footer ${ARROW_LIBRARIES})
# target_link_libraries(parquet-dump-footer ${ARROW_LIBRARIES})

add_dependencies(parquet ${PARQUET_TOOLS})
endif()
14 changes: 7 additions & 7 deletions cpp/tools/parquet/parquet_dump_footer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void AppendLE32(uint32_t v, std::string* out) {
out->append(reinterpret_cast<const char*>(&v), sizeof(v));
}

int DoIt(std::string in, bool scrub, bool json, std::string out) {
int DoIt(std::string in, bool scrub, bool debug, std::string out) {
std::string path;
auto fs = ::arrow::fs::FileSystemFromUriOrPath(in, &path).ValueOrDie();
auto file = fs->OpenInputFile(path).ValueOrDie();
Expand Down Expand Up @@ -73,8 +73,8 @@ int DoIt(std::string in, bool scrub, bool json, std::string out) {
file->ReadAt(file_len - tail_len, tail_len, data).ValueOrDie();
}
auto md = FileMetaData::Make(tail.data(), &metadata_len);
std::string ser = md->SerializeUnencrypted(scrub, json);
if (!json) {
std::string ser = md->SerializeUnencrypted(scrub, debug);
if (!debug) {
AppendLE32(static_cast<uint32_t>(ser.size()), &ser);
ser.append("PAR1", 4);
}
Expand Down Expand Up @@ -107,7 +107,7 @@ static int PrintHelp() {

int main(int argc, char** argv) {
bool scrub = true;
bool json = false;
bool debug = false;
std::string in;
std::string out;
for (int i = 1; i < argc; i++) {
Expand All @@ -116,8 +116,8 @@ int main(int argc, char** argv) {
return PrintHelp();
} else if (!std::strcmp(arg, "--no-scrub")) {
scrub = false;
} else if (!std::strcmp(arg, "--json")) {
json = true;
} else if (!std::strcmp(arg, "--debug")) {
debug = true;
} else if (!std::strcmp(arg, "--in")) {
if (i + 1 >= argc) return PrintHelp();
in = argv[++i];
Expand All @@ -131,5 +131,5 @@ int main(int argc, char** argv) {
}
if (in.empty()) return PrintHelp();

return parquet::DoIt(in, scrub, json, out);
return parquet::DoIt(in, scrub, debug, out);
}

0 comments on commit 6dd46cd

Please sign in to comment.