bug: gzip table metadata is neither written nor detected as gzip
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 66/100
Hướng nghiên cứu
Start in src/iceberg/table_metadata.cc, at Codec::FromFileName, where find_last_of(kTableMetadataFileSuffix) searches for any single character rather than the suffix, and at TableMetadataUtil::Write, which never compresses. The existing GZipDecompressor in util/gzip_internal.h is the model for a matching GZipCompressor. Done means a gzip-configured table writes gzip metadata that is read back correctly, and a name without .metadata.json is rejected. Both halves need to land together.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
With write.metadata.compression-codec=gzip, iceberg-cpp names new metadata files <version>-<uuid>.gz.metadata.json, the same layout Iceberg Java uses, but the round trip is broken on both sides:
TableMetadataUtil::Writenever compresses. It writes plain JSON into the.gz.metadata.jsonfile, so Java (or any reader that trusts the name) fails to inflate it.Codec::FromFileNamemisdetects the codec. It callsfind_last_of(".metadata.json"), which searches for any single character of that set, not the suffix. For00001-abc.gz.metadata.jsonit lands on the finaln, the.gzcheck fails, and the file is read as uncompressed. A gzip file written by Java under that name therefore fails to parse.
The two bugs mask each other inside iceberg-cpp: a file it writes is plain JSON and is read back as plain JSON, so its own round trip happens to work.
Root cause
src/iceberg/table_metadata.cc:
auto pos = file_name.find_last_of(kTableMetadataFileSuffix); // character-set search
and TableMetadataUtil::Write(io, location, metadata) serializes and calls io.WriteFile with no codec step. Only a GZipDecompressor exists in util/gzip_internal.h.
Java's TableMetadataParser.Codec.fromFileName uses lastIndexOf(".metadata.json"), and internalWrite wraps the stream in GZIPOutputStream when that codec is gzip.
Impact
A table configured with gzip metadata compression is not readable across engines in either direction: Java cannot read what iceberg-cpp writes, and iceberg-cpp cannot read what Java writes. The default codec is none, so tables without that property are unaffected.
The find_last_of bug also means FromFileName accepts names with no .metadata.json at all (e.g. foo.txt is classified as uncompressed), while Java rejects them.
Proposed fix
Use rfind in FromFileName, and compress in Write when the location's codec is gzip, with a small GZipCompressor next to the existing GZipDecompressor. Both halves have to land together: fixing only the read side makes iceberg-cpp try to inflate the plain JSON it writes today.
- Ngôn ngữ chính
- C++
- Star
- 226
- Fork
- 133
- Merge trung bình
- 6 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 49
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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/iceberg-cpp
-
bug: TableMetadataBuilder::RemoveSchemas leaves removed ids in the schema indexCó thể đã có người làm @LuciferYang đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/iceberg-cpp#1011 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
apache/iceberg-cpp#1000 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Support Iceberg table encryption (Java-compatible)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
apache/iceberg-cpp#988 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
apache/iceberg-cpp#959 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
apache/iceberg-cpp#946 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/iceberg-cpp
Issue tương tự
-
[Cleanup] Include the public header in work_split.cppCó thể đã có người làm @blozano-tt đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
tenstorrent/tt-metal#60850 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug core p3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
RunanywhereAI/runanywhere-sdks#1083 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
tesseract-ocr/tesseract#4653 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
comp-datalake performance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
ClickHouse/ClickHouse#126044 ·
Maintainer thường phản hồi trong vòng 1 ngày