Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ enquote = "1.1.0"
enum-as-inner = "0.6"
enum_dispatch = "0.3.13"
enumflags2 = { version = "0.7.7", features = ["serde"] }
ethnum = { version = "1.5.1", features = ["serde", "macros"] }
ethnum = { version = "1.5.2", features = ["serde", "macros"] }
faststr = "0.2"
feature-set = { version = "0.1.1" }
feistel-permutation-rs = "0.1.1"
Expand Down Expand Up @@ -353,7 +353,7 @@ jaq-interpret = "1.5.0"
jaq-parse = "1.0.3"
jaq-std = "1.6.0"
jiff = { version = "0.2.10", features = ["serde", "tzdb-bundle-always"] }
jsonb = "0.5.4"
jsonb = "0.5.5"
jwt-simple = { version = "0.12.10", default-features = false, features = ["pure-rust"] }
lenient_semver = "0.4.2"
levenshtein_automata = "0.2.1"
Expand Down Expand Up @@ -412,7 +412,7 @@ openraft = { version = "0.10.0", features = [
] }
opensrv-mysql = { git = "https://github.com/databendlabs/opensrv.git", tag = "v0.10.0", features = ["tls"] }
orc-rust = "0.6.0"
ordered-float = { version = "5.0.0", default-features = false }
ordered-float = { version = "5.1.0", default-features = false }
ordq = "0.2.0"
p256 = "0.13"
parking_lot = "0.12.1"
Expand Down Expand Up @@ -651,7 +651,6 @@ async-recursion = { git = "https://github.com/datafuse-extras/async-recursion.gi
backtrace = { git = "https://github.com/rust-lang/backtrace-rs.git", rev = "72265be" }
color-eyre = { git = "https://github.com/eyre-rs/eyre.git", rev = "e5d92c3" }
deltalake = { git = "https://github.com/delta-io/delta-rs", rev = "9954bff" }
jsonb = { git = "https://github.com/databendlabs/jsonb", rev = "425aae9" }
map-api = { git = "https://github.com/databendlabs/map-api", tag = "v0.4.2" }
openraft = { git = "https://github.com/databendlabs/openraft", tag = "v0.10.0-alpha.11" }
orc-rust = { git = "https://github.com/datafuse-extras/orc-rust", rev = "d82aa6d" }
Expand Down
6 changes: 3 additions & 3 deletions tests/data/ndjson/numbers.ndjson
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{"id": 1, "value": 100}
{"id": 2, "value": 200}
{"id": 3, "value": 300}
{"id": 1, "value": 100, "score": 1.0e38}
{"id": 2, "value": 200, "score": -1.0e77}
{"id": 3, "value": 300, "score": 1.0e999999}
23 changes: 19 additions & 4 deletions tests/sqllogictests/suites/stage/formats/ndjson/ndjson_cast.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ drop table if exists cast_ndjson
statement ok
CREATE TABLE cast_ndjson (name String, tags Map(String, String))

query
query TIBTI
copy into cast_ndjson from @data/ndjson/cast_sample.ndjson file_format = (type = NDJSON) ON_ERROR=continue
----
ndjson/cast_sample.ndjson 3 0 NULL NULL

query
query TT
select * from cast_ndjson
----
data1 {'env':'test1','length':'ok'}
Expand All @@ -19,14 +19,29 @@ data3 {'env':'test3','length':'10'}
statement ok
CREATE OR REPLACE TABLE cast_ts_ndjson (t timestamp)

query
query TIBTI
copy into cast_ts_ndjson from @data/ndjson/ts.ndjson file_format = (type = NDJSON) ON_ERROR=continue
----
ndjson/ts.ndjson 3 0 NULL NULL

query
query T
select * from cast_ts_ndjson order by t
----
2025-01-08 03:11:04.000000
2025-01-08 03:11:05.000000
2025-01-08 03:11:06.000000

statement ok
CREATE OR REPLACE TABLE number (id Int32, value Int64, score Variant)

query TIBTI
COPY INTO number FROM @data/ndjson/numbers.ndjson file_format = (type = NDJSON) ON_ERROR=continue
----
ndjson/numbers.ndjson 3 0 NULL NULL

query IIT
SELECT * FROM number
----
1 100 1e38
2 200 -1e77
3 300 null
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ select * from infer_schema(location => '@data/ndjson/numbers.ndjson', file_forma
----
id BIGINT 1 ndjson/numbers.ndjson 0
value BIGINT 1 ndjson/numbers.ndjson 1
score DOUBLE 1 ndjson/numbers.ndjson 2

query TTBTI
select * from infer_schema(location => '@data/ndjson/ragged.ndjson', file_format => 'NDJSON');
Expand Down Expand Up @@ -252,4 +253,4 @@ select CASE
from infer_schema(location => '@data/ndjson/max_file_count/', file_format => 'NDJSON', max_file_count => 2);
----
Y
Y
Y
Loading