parquet/file: a panic recovered in WriteBatch is not kept, so Close writes a footer for rows with no values

Abierto
#1,693 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@EdwardShen125 ya está trabajando en esto.

Desde el 27/11/2026.

  • #1694 de @EdwardShen125 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
go

Línea de trabajo

Start by reading the WriteBatch error recovery and Close paths for column chunk writers, then compare how FlushCurrentPage errors are saved, as referenced in issues #1597 and #1621. Reproduce the supplied example and check the resulting row count and footer behavior; done means Close returns the recovered error and no footer is written.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Describe the bug, including details regarding any error messages, version, and platform.

WriteBatch returns an error when it recovers a panic, but the error is not kept on the column, so every Close after it returns nil and the file ends up with a footer for rows that have no values. FlushCurrentPage errors are kept (#1597, #1621), recovered panics are not. This is the case @zeroshade noted in the #1621 review. On main:

root, _ := schema.NewGroupNode("schema", parquet.Repetitions.Required, schema.FieldList{
	schema.NewInt32Node("col", parquet.Repetitions.Optional, -1),
}, -1)
var buf bytes.Buffer
props := parquet.NewWriterProperties(parquet.WithDictionaryDefault(false))
w := file.NewParquetWriter(&buf, root, file.WithWriterProps(props))
rg := w.AppendRowGroup()
col, _ := rg.NextColumn()

_, err := col.(*file.Int32ColumnChunkWriter).WriteBatch([]int32{1}, []int16{1, 1, 1}, nil)
fmt.Println(err) // unknown error type: runtime error: slice bounds out of range [:3] with capacity 1
fmt.Println(col.Close(), rg.Close(), w.Close()) // <nil> <nil> <nil>

r, _ := file.NewParquetReader(bytes.NewReader(buf.Bytes()))
fmt.Println(r.MetaData().NumRows()) // 3; reading the column back gives 0 rows and no error

Expected: Close returns the saved error and no footer is written, same as for a FlushCurrentPage error.

Component(s)

Parquet

Lenguaje dominante
Assembly
Estrellas
423
Forks
188
Merge medio
1 d 7 h
PR fusionados (30 d)
164

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/arrow-go

Todos los issues de apache/arrow-go

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.