apache / apache/parquet-java

parquet-tools SimpleRecord does not display empty fields

未关闭
#2,224 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Component: Parquet Priority: Minor Type: bug
主要语言
Java
星标
3.1k
派生
1.6k
平均合并
3 天 12 小时
30 天内合并 PR
33

描述

When using parquet-tools on a parquet file with null records the null columns are omitted from the output.

 

Example:
```java

scala> case class Foo(a: Int, b: String)
defined class Foo

scala> org.apache.spark.sql.SparkSession.builder.getOrCreate.createDataset((0 to 1000).map(x => Foo(1,null))).write.parquet("/tmp/foobar/")
```
Actual:
```java

☁  parquet-tools [master] ⚡  java -jar target/parquet-tools-1.10.1-SNAPSHOT.jar cat -j /tmp/foobar/part-00000-436a4d37-d82a-4771-8e7e-e4d428464675-c000.snappy.parquet | head -n5
{"a":1}
{"a":1}
{"a":1}
{"a":1}
{"a":1}
```
Expected:
```java

☁  parquet-tools [master] ⚡  java -jar target/parquet-tools-1.10.1-SNAPSHOT.jar cat -j /tmp/foobar/part-00000-436a4d37-d82a-4771-8e7e-e4d428464675-c000.snappy.parquet | head -n5
{"a":1,"b":null}
{"a":1,"b":null}
{"a":1,"b":null}
{"a":1,"b":null}
{"a":1,"b":null}
```
 

**Reporter**: [Nicholas Rushton](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=Nick+Rushton)
#### PRs and other links:
- [GitHub Pull Request #518](https://github.com/apache/parquet-mr/pull/518)

**Note**: *This issue was originally created as [PARQUET-1408](https://issues.apache.org/jira/browse/PARQUET-1408). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 parquet-tools 的 `cat -j` 命令及其 `SimpleRecord` 输出路径入手,使用提供的空字段示例作为复现用例。完成的标准是:包含空列的记录在输出时这些字段仍然存在并设置为 null,与预期的 JSON 输出一致;查看 Pull Request #518 了解已有工作。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
cli, data
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。