bug: gzip table metadata is neither written nor detected as gzip
Les mainteneurs répondent en général sous 2 jours
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 66/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- C++
- Étoiles
- 226
- Forks
- 133
- Merge moyen
- 6 j 2 h
- PR mergées (30 j)
- 49
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/iceberg-cpp
-
bug: TableMetadataBuilder::RemoveSchemas leaves removed ids in the schema indexPeut-être pris @LuciferYang l’a pris il y a 1 jour. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
apache/iceberg-cpp#1011 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
apache/iceberg-cpp#1000 · 2 commentaires · 1 réaction ·
Les mainteneurs répondent en général sous 2 jours
-
Support Iceberg table encryption (Java-compatible)Peut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 8/100
apache/iceberg-cpp#988 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 20/100
apache/iceberg-cpp#959 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
apache/iceberg-cpp#946 · 6 commentaires ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de apache/iceberg-cpp
Issues similaires
-
[Cleanup] Include the public header in work_split.cppPeut-être pris @blozano-tt l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
tenstorrent/tt-metal#60850 ·
Les mainteneurs répondent en général sous 1 jour
-
bug core p3
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
RunanywhereAI/runanywhere-sdks#1083 ·
Les mainteneurs répondent en général sous 5 jours
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 75/100
tesseract-ocr/tesseract#4653 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
comp-datalake performance
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
ClickHouse/ClickHouse#126044 ·
Les mainteneurs répondent en général sous 1 jour