[BUG] `CompactProtocolFieldWriter` does not write empty value string in key-value pair
- 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
Assessment
This issue has not been assessed yet.