apache / apache/parquet-java

parquet-cli reports nested columns as null

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

描述

### Describe the bug, including details regarding any error messages, version, and platform.

Using Parquet CLI 1.15.0 via Mac Homebrew, I noticed some surprising behaviour with the `parquet-cli` and nested columns.

`parquet schema catalog.parquet` returns a schema showing the nested types (I've trimmed the field list slightly):

```avro
{
"type" : "record",
"name" : "schema",
"fields" : [ {
"name" : "item_id",
"type" : "string"
}, {
"name" : "title",
"type" : [ "null", "string" ],
"default" : null
}, {
"name" : "language",
"type" : [ "null", "string" ],
"default" : null
}, {
"name" : "subjects",
"type" : [ "null", {
"type" : "array",
"items" : {
"type" : "record",
"name" : "list",
"fields" : [ {
"name" : "element",
"type" : "string"
} ]
}
} ],
"default" : null
}, {
"name" : "authors",
"type" : [ "null", {
"type" : "array",
"items" : {
"type" : "record",
"name" : "list",
"namespace" : "list2",
"fields" : [ {
"name" : "element",
"type" : "string"
} ]
}
} ],
"default" : null
} ]
}
```

`parquet dictionary -c subjects.list.element catalog.parquet` will return the expected values for those fields as well:

```
Row group 0 dictionary for "subjects.list.element":
0: "Bestsellers"
1: "Biography"
2: "Fantasy Fiction"
3: "Music Theory"
4: "Disability"
5: "Family"
6: "Young Adult"
```

However, when using `cat` or `head` to display the file contents those fields are displayed as null:

```
{"bmc_id": "id1", "title": null, "language": "en", "subjects": null, "authors": null}
{"bmc_id": "id2", "title": null, "language": "en", "subjects": null, "authors": null,}
{"bmc_id": "id3", "title": null, "language": "en", "subjects": null, "authors": null}
```

Other tools like PyArrow or Pandas do display those values as arrays. I created this as a bug because it _looks_ like it's working and if those fields are nullable, there's no way to tell whether the null value is correct.

### Component(s)

_No response_

贡献指南

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

调研方向

使用 `parquet schema`、`parquet dictionary -c subjects.list.element` 以及对 `catalog.parquet` 执行的 `cat` 或 `head`,复现 Parquet CLI 1.15.0 中的问题。将 dictionary 命令报告的嵌套列值与显示的记录进行比较,并检查处理这些命令的 parquet-cli 路径。完成标准是 `cat` 和 `head` 显示嵌套数组,而不是错误地将其显示为 null。

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

评估

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

把新 issue 发到你的邮箱

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