Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Bug]: Hudi snapshot file sizes overflow above Integer.MAX_VALUE

Cerrado
#4,407 1 comentario 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 2 días

@hutiefang76 ya está trabajando en esto.

Desde el 1/10/2026.

  • #4408 de @hutiefang76 — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

What happened?

HudiTableDescriptor.getSnapshots casts the long total file size to int before assigning it to a long field. A 3 GiB snapshot therefore becomes -1073741824 bytes instead of 3221225472 bytes. Larger values can also wrap to a smaller positive size.

Affects Versions

Reproduced on master at 9442f8c. Released versions have not been checked.

What table formats are you seeing the problem on?

Hudi

What engines are you seeing the problem on?

AMS

How to reproduce
  1. Provide a HudiSnapshot with total file size 3221225472L (3 GiB) through HudiTable.getSnapshotList.
  2. Call HudiTableDescriptor.getSnapshots and read getOriginalFileSize() on the returned snapshot.
  3. The result is -1073741824L; expected 3221225472L.

The regression test uses a real Hudi snapshot and descriptor, with the table snapshot lookup mocked so it does not require Hudi storage.

Relevant log output

For a 3 GiB snapshot: expected: <3221225472> but was: <-1073741824>.

Anything else

Proposed fix: Remove the narrowing int cast. Add size-boundary regressions, including Integer.MAX_VALUE, 2 GiB, 3 GiB and 5 GiB, plus field-mapping, operation-filtering and empty-list coverage.

Code was assisted by DeepSeek v4 Flash via Reasonix 1.39.4; submission text was assisted by Codex. The patch and local test results were reviewed.

Are you willing to submit a PR?
  • Yes I am willing to submit a PR!
Code of Conduct
  • I agree to follow this project's Code of Conduct
Lenguaje dominante
Java
Estrellas
1.2k
Forks
397
Merge medio
2 d 17 h
PR fusionados (30 d)
20

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/amoro

Todos los issues de apache/amoro

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.