Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

ProtoSchemaConverter renders invalid schema for oneof in unwrap mode

未关闭
#3,039 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

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

调研方向

从 parquet-protobuf/src/main/java/org/apache/parquet/proto/ProtoSchemaConverter.java 中 unwrap repetition 的处理开始,然后检查 TestProto3.OneOfTestMessage fixture 及其测试。在 parquet-protobuf/src/test/java/org/apache/parquet/proto/TestUtils.java 中启用 validation,并为 unwrap mode 添加 coverage。完成的标准是 oneof conversion 生成有效的 schema,并且相关的 read path 得到测试。

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

描述

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

When unwrap is enabled all fields of the TestProto3.OneOfTestMessage will be required.

message TestProto3.OneOfTestMessage {
  required int32 first = 1;
  required int32 second = 2;
}

https://github.com/apache/parquet-java/blob/73a4430af6c40f8eb246ad4911eb6d103c9a2abe/parquet-protobuf/src/test/resources/TestProto3.proto#L116

This will never work but tests are missing for unwrap of TestProto3.OneOfTestMessage

The required repetition is added here:
https://github.com/apache/parquet-java/blob/73a4430af6c40f8eb246ad4911eb6d103c9a2abe/parquet-protobuf/src/main/java/org/apache/parquet/proto/ProtoSchemaConverter.java#L278

This could be caught early by adding withValidation(true) here:
https://github.com/apache/parquet-java/blob/73a4430af6c40f8eb246ad4911eb6d103c9a2abe/parquet-protobuf/src/test/java/org/apache/parquet/proto/TestUtils.java#L221

If validation is disabled it will fail when trying to read one of the non-existing fields in the oneof.

Is there really a need for setting all primitive fields in unwrap to required?

Component(s)

No response

主要语言
Java
星标
3.1k
派生
1.6k
平均合并
6 天 44 分钟
30 天内合并 PR
35

贡献指南

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

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/parquet-java 的其他 Issue

查看 apache/parquet-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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