JSONL File Scan reads a JSON null as the text "null"
维护者通常 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?
- Upload a JSONL file with these two lines:
{"a":1} {"a":null} - Add a JSONL File Scan that reads it and run the workflow.
- Column
ais inferred as STRING, and the two rows hold the text"1"and the text"null". Expected: INTEGER, with1and 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
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/texera 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
相似的 Issue
-
bug performance priority:medium regression
难度 2/5 1-3 小时 新手友好度 78/100
apache/datafusion-comet#6313 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 70/100
com-lihaoyi/mill#7624 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
lichess-org/lila#21845 ·
维护者通常 1 天内回复
-
Files.createDirectories throws a bare IOException when another process creates the directory first未关闭
难度 2/5 1-3 小时 新手友好度 78/100
scala-native/scala-native#5077 ·
维护者通常 1 天内回复