Native Parquet write falls back on int96RebaseModeInWrite=LEGACY even when timestamps are not written as INT96

Abierto Apto para principiantes
#7,463 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
62/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust, scala, spark

Línea de trabajo

El fallback está en NativeWriteUtils.legacyDatetimeRebaseWriteReason; empieza allí y lee cómo inspecciona int96RebaseModeInWrite antes de comprobar el tipo de timestamp de salida. Añade una condición para que la comprobación de INT96 se aplique solo cuando spark.sql.parquet.outputTimestampType sea INT96, y luego añade una prueba de regresión con TIMESTAMP_MICROS y int96RebaseModeInWrite=LEGACY que afirme que la escritura se mantiene nativa. Está terminado cuando esa prueba pasa y se actualiza el párrafo de docs/source/user-guide/latest/parquet.md.

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

Descripción

area:writer enhancement requires-triage
What is the problem the feature request solves?

Found in review of #7053. The native Parquet writer fallback added there, NativeWriteUtils.legacyDatetimeRebaseWriteReason, treats spark.sql.parquet.int96RebaseModeInWrite=LEGACY as a reason to fall back whenever the output has a timestamp column. That setting only governs the INT96 encoding. When spark.sql.parquet.outputTimestampType is TIMESTAMP_MICROS or TIMESTAMP_MILLIS, Spark writes INT64 and uses datetimeRebaseModeInWrite instead, so the INT96 setting has no effect on the output.

Reproduction: a timestamp column, outputTimestampType=TIMESTAMP_MICROS, datetimeRebaseModeInWrite=CORRECTED. Changing only int96RebaseModeInWrite from CORRECTED to LEGACY makes the helper return a fallback reason instead of None. Spark writes the same INT64 TIMESTAMP(MICROS) either way (for 1500-01-01 12:34:56.123456 both files contain -14831724303876544).

The fallback is safe, but an unrelated legacy INT96 setting disables native write acceleration for a write the native writer handles correctly.

Describe the potential solution

Only apply the INT96 condition when spark.sql.parquet.outputTimestampType is INT96. The native writer always writes INT64 microseconds and ignores outputTimestampType when writing, so the check has to read the session conf.

Add a regression test with a non-INT96 timestamp output and int96RebaseModeInWrite=LEGACY that asserts the write stays native and matches Spark's value. Update the paragraph in docs/source/user-guide/latest/parquet.md that names int96RebaseModeInWrite=LEGACY as a fallback trigger.

Additional context

Reviewer comment: https://github.com/apache/datafusion-comet/pull/7053#discussion_r4458640616

Follow-on to #7053, which should merge first.

Lenguaje dominante
Scala
Estrellas
1.3k
Forks
405
Merge medio
3 d 3 h
PR fusionados (30 d)
269

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/datafusion-comet

Todos los issues de apache/datafusion-comet

Issues similares

Más issues de Scala

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.