Isolate Avro usage in parquet-cli to commands that require Avro
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- java
- Lĩnh vực
- cli, data-engineering
Hướng nghiên cứu
Bắt đầu bằng cách lần theo các điểm vào của parquet-cli cho các lệnh cat, head, scan, schema, conversion và rewrite, bao gồm cả fallback GroupReadSupport hiện có. Tái hiện các lỗi với data/nested_lists.snappy.parquet, shredded_variant/case-001.parquet và data/int96_from_spark.parquet. Hoàn thành khi việc kiểm tra Parquet và các thao tác ghi lại vật lý sử dụng các đường dẫn native, trong khi Avro vẫn được dùng cho các workflow chuyển đổi và các đầu vào không phải Parquet.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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-instructionandcolumn with known typeare valid Parquet field names but invalid Avro names. This already required acat/headgroup-reader fallback. - Nested Parquet structures:
data/nested_lists.snappy.parquetis a validparquet-testingfixture, butcatandscanfail 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
- https://github.com/apache/parquet-java/issues/2836 / https://github.com/apache/parquet-java/pull/3332:
catfailed because Avro rejected a Parquet field name. The merged fix added a Parquet group-reader fallback. - https://github.com/apache/parquet-java/issues/2835:
headreported the same class of invalid Avro field-name failure. - https://github.com/apache/parquet-java/issues/2708:
catfailed on parquet-protobuf files with modern LIST encoding viaAvroRecordConverter. - https://github.com/apache/parquet-java/issues/1641: UUID values failed because Avro projection changed the requested physical type; skipping projection let the file read.
- https://github.com/apache/parquet-java/issues/3345: INT96 data failed through Avro requested-schema conversion.
- https://github.com/apache/parquet-java/issues/3477: Avro schema conversion dropped
typed_valuefrom shredded Variant schemas. - https://github.com/apache/parquet-java/issues/2339:
convert-csvhit Avro naming rules. This should stay in the Avro-backed conversion area, not drive Parquet inspection behavior.
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, butcatandscanfail during Avro-backed record reading withParquetDecodingException, followed byGroupColumnIO.getFirstindex failure.shredded_variant/case-001.parquet: Avro schema conversion succeeds, butcatandscanfail during Avro-backed record reading withParquetDecodingException, followed byGroupColumnIO.getLastindex failure.data/int96_from_spark.parquet: Avro schema conversion fails before reading records withArgument error: INT96 is deprecated..., blocking Parquet row inspection.
- Ngôn ngữ chính
- Java
- Star
- 3.1k
- Fork
- 1.6k
- Merge trung bình
- 4 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 30
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/parquet-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
apache/parquet-java#3829 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
apache/parquet-java#3820 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Make PageReader AutoCloseableĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/parquet-java#3767 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/parquet-java#3695 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/parquet-java#3667 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/parquet-java
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
type: possible bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
grimmory-tools/grimmory#2850 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pdf
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
portfolio-performance/portfolio#6103 ·
Maintainer thường phản hồi trong vòng 7 ngày