Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#8,674 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
86/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
scala

调研方向

从 JSONUtils.JSONToMap 开始,检查对 JSON null 的值节点处理。运行 JSONUtilsSpec,包括针对 null 的两个断言,并使用 {"a":1} 和 {"a":null} 验证 JSONL File Scan 的复现。完成的标准是 null 仍然为空值,并且模式推断生成 INTEGER 列而不是 STRING 列。

由索引模型根据 Issue 内容生成。

描述

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)
主要语言
Scala
星标
316
派生
189
平均合并
4 天 6 小时
30 天内合并 PR
161

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/texera 的其他 Issue

查看 apache/texera 的全部 Issue

相似的 Issue

更多 Scala Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。