read_side_padding ignores the pad string for dictionary inputs in lpad and rpad
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
- 72/100
Línea de trabajo
El error está en native/spark-expr/src/static_invoke/char_varchar_utils/read_side_padding.rs, en la rama de tres argumentos que captura las entradas Dictionary: ambas ramas de Dictionary pasan SPACE, mientras que las ramas Utf8 y LargeUtf8 pasan la cadena de relleno. Lee primero esa rama y luego añade una prueba unitaria con una entrada Dictionary y un relleno distinto de espacio, como "x", que espere ["abxxx", "abxxx"]. Está terminado cuando el resultado de Dictionary coincida con el resultado de Utf8 para la misma entrada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
In read_side_padding.rs, the three-argument arm ([Array, Scalar(Int32), Scalar(Utf8)]) ignores the pad string when the input is a dictionary array. The Utf8 and LargeUtf8 branches pass string to spark_read_side_padding_internal, but both Dictionary branches pass SPACE. So rpad/lpad with a custom pad pads with spaces instead.
Steps to reproduce
Kernel-level, on main at 644a87088:
let dict: DictionaryArray<Int32Type> = vec!["ab", "ab"].into_iter().collect();
let args = vec![
ColumnarValue::Array(Arc::new(dict)),
ColumnarValue::Scalar(ScalarValue::Int32(Some(5))),
ColumnarValue::Scalar(ScalarValue::Utf8(Some("x".to_string()))),
];
spark_rpad(&args) // ["ab ", "ab "]
I couldn't find a SQL query that reaches this today. The native scan input unpacks dictionary-encoded strings (see test_unpack_dictionary_string in planner.rs), and the existing string_rpad.sql tests with a custom pad pass. So this looks latent, but it would give silent wrong results if a dictionary array ever reaches the kernel, which is what the Dictionary arm (added for SPARK-48498) is there for.
Expected behavior
["abxxx", "abxxx"], the same as for a Utf8 input.
Additional context
Found while reviewing my change for #7245 (PR #7450). The fix is to pass string instead of SPACE in the two Dictionary branches and add a unit test with a dictionary input and a non-space pad.
Willingness to contribute
I can contribute a fix for this bug independently
AI disclosure: this issue was investigated and written with an AI coding assistant, and reviewed by me.
- Lenguaje dominante
- Scala
- Estrellas
- 1.3k
- Forks
- 405
- Merge medio
- 3 d 3 h
- PR fusionados (30 d)
- 269
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/datafusion-comet
-
requires-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/datafusion-comet#7479 ·
Los mantenedores suelen responder en 2 días
-
area:writer enhancement requires-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
apache/datafusion-comet#7463 ·
Los mantenedores suelen responder en 2 días
-
requires-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/datafusion-comet#7458 ·
Los mantenedores suelen responder en 2 días
-
area:ci enhancement priority:low requires-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
apache/datafusion-comet#7319 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
area:ci bug priority:low requires-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/datafusion-comet#7315 ·
Los mantenedores suelen responder en 2 días
Todos los issues de apache/datafusion-comet
Issues similares
-
bug 🐞 python 🐍
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
valkey-io/valkey-glide#7560 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
bug minor
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
propensive/soundness#2418 ·
Los mantenedores suelen responder en 1 día
-
Broken links in the docsAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
digital-asset/canton#710 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
scylladb/scylla-migrator#432 ·
Los mantenedores suelen responder en 1 día