Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary fix Parquet metadata with empty value string being ignored from writing #14026

Merged
merged 5 commits into from
Sep 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions java/src/main/native/src/TableJni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,11 @@ JNIEXPORT long JNICALL Java_ai_rapids_cudf_Table_writeParquetBufferBegin(
std::map<std::string, std::string> kv_metadata;
std::transform(meta_keys.begin(), meta_keys.end(), meta_values.begin(),
std::inserter(kv_metadata, kv_metadata.end()),
[](auto const &key, auto const &value) { return std::make_pair(key, value); });
[](auto const &key, auto const &value) {
// The metadata value will be ignored if it is empty.
// We modify it into a space character to workaround such issue.
return std::make_pair(key, value.empty() ? std::string(" ") : value);
});

auto stats = std::make_shared<cudf::io::writer_compression_statistics>();
chunked_parquet_writer_options opts =
Expand Down Expand Up @@ -1638,7 +1642,11 @@ JNIEXPORT long JNICALL Java_ai_rapids_cudf_Table_writeParquetFileBegin(
std::map<std::string, std::string> kv_metadata;
std::transform(meta_keys.begin(), meta_keys.end(), meta_values.begin(),
std::inserter(kv_metadata, kv_metadata.end()),
[](auto const &key, auto const &value) { return std::make_pair(key, value); });
[](auto const &key, auto const &value) {
// The metadata value will be ignored if it is empty.
// We modify it into a space character to workaround such issue.
return std::make_pair(key, value.empty() ? std::string(" ") : value);
});

sink_info sink{output_path.get()};
auto stats = std::make_shared<cudf::io::writer_compression_statistics>();
Expand Down