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

Isolate Avro usage in parquet-cli to commands that require Avro

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

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
冷清
技术栈
java

调研方向

首先跟踪 parquet-cli 中 cat、head、scan、schema、conversion 和 rewrite 命令的入口点,包括现有的 GroupReadSupport fallback。使用 data/nested_lists.snappy.parquet、shredded_variant/case-001.parquet 和 data/int96_from_spark.parquet 重现这些失败。完成的标准是:Parquet 检查和物理重写使用原生路径,同时 Avro 仍用于转换工作流和非 Parquet 输入。

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

描述

Motivation

parquet-cli still uses Avro as an internal row model in places where users are only trying to inspect Parquet files. Valid Parquet is not always valid Avro, so Parquet inspection should not require Parquet schemas or records to round-trip through Avro.

cat/head already has a group-reader fallback for one class of problem: Avro schema conversion failures such as invalid Avro field names. That fallback is useful, but it is still a special case. Other inspection paths, such as scan, still use the Avro-backed data path for Parquet input.

Concrete examples:

  • Invalid Avro field names: original-instruction and column with known type are valid Parquet field names but invalid Avro names. This already required a cat/head group-reader fallback.
  • Nested Parquet structures: data/nested_lists.snappy.parquet is a valid parquet-testing fixture, but cat and scan fail through the Avro-backed reader.
  • Projection/type mismatch: UUID and INT96 Parquet columns can fail when Avro projection rewrites the requested physical type.
  • Lost Parquet structure: shredded Variant and other newer logical types can have valid Parquet physical structures that Avro cannot represent without losing information.

Avro is still part of the CLI API for conversion workflows. The goal is not to remove Avro; it is to stop requiring Avro for Parquet inspection.

Proposal

Use Avro only when the command or input/output format requires it. Use Parquet-native readers and metadata APIs for Parquet inspection and physical rewrites.

Command Avro needed? Proposed internal path
help, version No CLI metadata only
meta, pages, dictionary, check-stats, column-index, column-size, footer, bloom-filter, size-stats, geospatial-stats No ParquetFileReader and Parquet metadata/page/stat APIs
prune, trans-compression, masking, rewrite No Parquet rewrite utilities
cat, head Only for non-Parquet inputs Parquet -> GroupReadSupport; Avro/JSON -> Avro path
scan Only for non-Parquet inputs Parquet -> GroupReadSupport; Avro/JSON -> Avro path
schema Yes by default Keep Avro schema output; keep physical Parquet path for --parquet
csv-schema Yes Avro schema inference
convert-csv Yes CSV -> Avro records/schema -> Parquet
convert Yes Avro-backed conversion path
to-avro Yes Avro writer/schema path

Related issues

Tangential: https://github.com/apache/parquet-java/issues/2657 and https://github.com/apache/parquet-java/issues/2630 show additional CLI coupling to Avro internals, but are mostly binary/API mismatch issues.

Summary

Keep Avro for Avro-facing workflows: schema default output, to-avro, convert, CSV/JSON conversion, and Avro input handling.

Use Parquet-native readers for Parquet inspection and physical rewrites. This preserves the Avro API where intentional while making parquet-cli more robust for valid Parquet files that Avro cannot model.

Appendix
Repro examples

Using parquet-mr version 1.17.1 and fixtures from apache/parquet-testing:

git clone https://github.com/apache/parquet-testing.git
cd parquet-testing

These Parquet inspection commands currently fail:

parquet cat -n 1 data/nested_lists.snappy.parquet
parquet scan data/nested_lists.snappy.parquet

parquet cat -n 1 shredded_variant/case-001.parquet
parquet scan shredded_variant/case-001.parquet

parquet cat -n 1 data/int96_from_spark.parquet
parquet scan data/int96_from_spark.parquet

Observed failure classes:

  • data/nested_lists.snappy.parquet: Avro schema conversion succeeds, but cat and scan fail during Avro-backed record reading with ParquetDecodingException, followed by GroupColumnIO.getFirst index failure.
  • shredded_variant/case-001.parquet: Avro schema conversion succeeds, but cat and scan fail during Avro-backed record reading with ParquetDecodingException, followed by GroupColumnIO.getLast index failure.
  • data/int96_from_spark.parquet: Avro schema conversion fails before reading records with Argument error: INT96 is deprecated..., blocking Parquet row inspection.
主要语言
Java
星标
3.1k
派生
1.6k
平均合并
6 天 16 小时
30 天内合并 PR
36

贡献指南

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

从这里开始

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

apache/parquet-java 的其他 Issue

查看 apache/parquet-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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