JSONL File Scan reads a JSON null as the text "null"
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 86/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- scala
調査の方向性
JSONUtils.JSONToMap から開始し、JSON null に対する value-node の処理を調べます。JSONUtilsSpec を実行し、null に対する 2 つのアサーションを含めて確認し、{"a":1} と {"a":null} を使って JSONL File Scan の再現を検証します。null が空の値のまま維持され、スキーマ推論によって STRING ではなく INTEGER 列が生成されれば完了です。
索引モデルが 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日 23時間
- マージ済み PR(30日)
- 157
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/texera のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
apache/texera#8775 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
apache/texera#8756 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/texera#8700 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
apache/texera#8682 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
Code Cleanup dependencies
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
ProjectSidewalk/SidewalkWebpage#5609 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
go 🏃 testing 🧪
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
valkey-io/valkey-glide#7239 ·
メンテナーはふだん 3 日以内に返信
-
itype:bug stat:needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
com-lihaoyi/mill#7640 ·
メンテナーはふだん 1 日以内に返信