Skip to content

Commit

Permalink
[regression-test](load) add something like $.tag.[a.b] key's json case (
Browse files Browse the repository at this point in the history
  • Loading branch information
felixwluo authored and dataroaring committed May 31, 2024
1 parent f4f906f commit 2843f88
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions regression-test/data/load_p0/stream_load/test_json_load.out
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,6 @@ John 30 New York {"email":"[email protected]","phone":"+1-123-456-7890"}
android \N \N \N \N \N
android \N \N \N \N \N

-- !select28 --
test k2_value

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"tags": {"a.b": "test","k2": "k2_value"}}
26 changes: 26 additions & 0 deletions regression-test/suites/load_p0/stream_load/test_json_load.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -827,4 +827,30 @@ suite("test_json_load", "p0") {
} finally {
try_sql("DROP TABLE IF EXISTS ${testTable}")
}

// add something like $.tag. [a.b] key's json case
try {
sql "DROP TABLE IF EXISTS ${testTable}"
sql """CREATE TABLE IF NOT EXISTS ${testTable}
(
`k1` varchar(1024) NULL,
`k2` varchar(1024) NULL
)
DUPLICATE KEY(`k1`)
COMMENT ''
DISTRIBUTED BY RANDOM BUCKETS 1
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
);"""

load_json_data.call("${testTable}", "${testTable}_case28_1", 'false', '', 'json', '', '[\"$.tags.\\\"a.b\\\"\",\"$.tags.k2\"]',
'', '', '', 'test_special_key_json.json')

sql "sync"
sleep(1000)
qt_select28 "select * from ${testTable}"

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

0 comments on commit 2843f88

Please sign in to comment.