NVIDIA / NVIDIA/cudf

[BUG] `CompactProtocolFieldWriter` does not write empty value string in key-value pair

Open
#14,024 7 comments 0 reactions 0 assignees View on GitHub
2 - In Progress bug cuIO libcudf
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

During debugging a Parquet issue, I found that the Parquet metadata is not correctly written by cudf. In particular, in a round trip test, a pair of metadata `{"key_str", ""}` is written then read as `{"key_str", null}` in Spark. This is due to the `CompactProtocolFieldWriter` does not write empty value string:
```
size_t CompactProtocolWriter::write(KeyValue const& k)
{
CompactProtocolFieldWriter c(*this);
c.field_string(1, k.key);
if (not k.value.empty()) { c.field_string(2, k.value); } <================ here
return c.value();
}
```

We should write all value strings even for empty value.

However, I'm not sure if this is the expected behavior of compact protocol?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.