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
1 change: 1 addition & 0 deletions be/src/vec/exec/format/json/new_json_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,7 @@ Status NewJsonReader::_simdjson_write_columns_by_jsonpath(
if (slot_desc->is_nullable()) {
nullable_column = assert_cast<ColumnNullable*>(column_ptr);
target_column_ptr = &nullable_column->get_nested_column();
nullable_column->get_null_map_data().push_back(0);
}
auto* column_string = assert_cast<ColumnString*>(target_column_ptr);
column_string->insert_data(_simdjson_ondemand_padding_buffer.data(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,11 @@ test k2_value

-- !select31 --
789 beijing haidian
1111 \N \N
1111 \N \N

-- !select30 --
12345 {"k1":12345,"k2":"11111","k3":111111,"k4":[11111]} {"k1":12345,"k2":"11111","k3":111111,"k4":[11111]} 111111
12346 {"k1":12346,"k2":"22222","k4":[22222]} {"k1":12346,"k2":"22222","k4":[22222]} \N
12347 {"k1":12347,"k3":"33333","k4":[22222]} {"k1":12347,"k3":"33333","k4":[22222]} 33333
12348 {"k1":12348,"k3":"33333","k5":{"k51":1024,"xxxx":[11111]}} {"k1":12348,"k3":"33333","k5":{"k51":1024,"xxxx":[11111]}} 33333

Original file line number Diff line number Diff line change
Expand Up @@ -932,4 +932,31 @@ suite("test_json_load", "p0,nonConcurrent") {
} finally {
// try_sql("DROP TABLE IF EXISTS ${testTable}")
}

// support read "$." as root with json type
try {
sql "DROP TABLE IF EXISTS ${testTable}"
sql """CREATE TABLE IF NOT EXISTS ${testTable}
(
`k1` varchar(1024) NULL,
`k2` json NULL,
`k3` json NULL,
`k4` json NULL
)
DUPLICATE KEY(`k1`)
COMMENT ''
DISTRIBUTED BY RANDOM BUCKETS 1
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
);"""

load_json_data.call("${testTable}", "${testTable}_case30", 'false', 'true', 'json', '', '[\"$.k1\",\"$.\", \"$.\", \"$.k3\"]',
'', '', '', 'test_read_root_path.json')

sql "sync"
qt_select30 "select * from ${testTable} order by k1"

} finally {
// try_sql("DROP TABLE IF EXISTS ${testTable}")
}
}
Loading