bug: gzip table metadata is neither written nor detected as gzip
Mantenedores costumam responder em até 2 dias
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 66/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- C++
- Estrelas
- 226
- Forks
- 133
- Merge médio
- 6d 2h
- PRs com merge (30d)
- 49
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de apache/iceberg-cpp
-
bug: TableMetadataBuilder::RemoveSchemas leaves removed ids in the schema indexTalvez já em andamento @LuciferYang assumiu há 1 dia. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
apache/iceberg-cpp#1011 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
apache/iceberg-cpp#1000 · 2 comentários · 1 reação ·
Mantenedores costumam responder em até 2 dias
-
Support Iceberg table encryption (Java-compatible)Talvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 8/100
apache/iceberg-cpp#988 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 20/100
apache/iceberg-cpp#959 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
apache/iceberg-cpp#946 · 6 comentários ·
Mantenedores costumam responder em até 2 dias
Todas as issues de apache/iceberg-cpp
Issues semelhantes
-
[Cleanup] Include the public header in work_split.cppTalvez já em andamento @blozano-tt assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
tenstorrent/tt-metal#60850 ·
Mantenedores costumam responder em até 1 dia
-
bug core p3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
RunanywhereAI/runanywhere-sdks#1083 ·
Mantenedores costumam responder em até 5 dias
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 75/100
tesseract-ocr/tesseract#4653 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
comp-datalake performance
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
ClickHouse/ClickHouse#126044 ·
Mantenedores costumam responder em até 1 dia