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

JSONL File Scan reads a JSON null as the text "null"

Abierto Apto para principiantes
#8,674 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

Comienza en JSONUtils.JSONToMap e inspecciona el manejo del nodo de valor para JSON null. Ejecuta JSONUtilsSpec, incluidas sus dos aserciones para null, y verifica la reproducción de JSONL File Scan con {"a":1} y {"a":null}. Se considera terminado cuando null sigue siendo un valor vacío y la inferencia del esquema produce una columna INTEGER en lugar de STRING.

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

Descripción

What happened?

The JSONL File Scan reads a JSON null as the text "null". One null in a column is enough to make the whole column STRING, so a column of numbers comes out as text and its missing value is the word null rather than an empty cell. A sort, a filter or any arithmetic downstream then works on the wrong type.

The cause is JSONUtils.JSONToMap: a null is a value node, so it takes the child.asText() branch, and NullNode.asText() returns "null". Schema inference then fails to parse "null" as a number and widens the column to STRING.

Two assertions in JSONUtilsSpec expect "null" today. They were added in #4716, whose description says the spec pins the current behavior so that a fix has to update it on purpose.

How to reproduce?
  1. Upload a JSONL file with these two lines:
    {"a":1}
    {"a":null}
    
  2. Add a JSONL File Scan that reads it and run the workflow.
  3. Column a is inferred as STRING, and the two rows hold the text "1" and the text "null". Expected: INTEGER, with 1 and an empty value.
Version/Branch

1.4.0-incubating-SNAPSHOT (main)

Commit Hash (Optional)

53052c482

What browsers are you seeing the problem on?

No response

Relevant log output
Schema[Attribute[name=a, type=string]]
row 1: '1' (String)
row 2: 'null' (String)
Lenguaje dominante
Scala
Estrellas
316
Forks
189
Merge medio
4 d 5 h
PR fusionados (30 d)
165

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/texera

Todos los issues de apache/texera

Issues similares

Más issues de Scala

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.