mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Merge pull request #34454 from kitaisreal/dictionary-get-http-json-test
Added test 33734
This commit is contained in:
commit
e0dfc9cd38
@ -0,0 +1,24 @@
|
|||||||
|
0 Value
|
||||||
|
{
|
||||||
|
"meta":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "dictGet(02154_test_dictionary, 'value', toUInt64(0))",
|
||||||
|
"type": "String"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dictGet(02154_test_dictionary, 'value', toUInt64(1))",
|
||||||
|
"type": "String"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"data":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"dictGet(02154_test_dictionary, 'value', toUInt64(0))": "Value",
|
||||||
|
"dictGet(02154_test_dictionary, 'value', toUInt64(1))": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"rows": 1
|
||||||
|
}
|
39
tests/queries/0_stateless/02154_dictionary_get_http_json.sh
Executable file
39
tests/queries/0_stateless/02154_dictionary_get_http_json.sh
Executable file
@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
# shellcheck source=../shell_config.sh
|
||||||
|
. "$CURDIR"/../shell_config.sh
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS 02154_test_source_table"
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT -q """
|
||||||
|
CREATE TABLE 02154_test_source_table
|
||||||
|
(
|
||||||
|
id UInt64,
|
||||||
|
value String
|
||||||
|
) ENGINE=TinyLog;
|
||||||
|
"""
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT -q "INSERT INTO 02154_test_source_table VALUES (0, 'Value')"
|
||||||
|
$CLICKHOUSE_CLIENT -q "SELECT * FROM 02154_test_source_table"
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT -q "DROP DICTIONARY IF EXISTS 02154_test_dictionary"
|
||||||
|
$CLICKHOUSE_CLIENT -q """
|
||||||
|
CREATE DICTIONARY 02154_test_dictionary
|
||||||
|
(
|
||||||
|
id UInt64,
|
||||||
|
value String
|
||||||
|
)
|
||||||
|
PRIMARY KEY id
|
||||||
|
LAYOUT(HASHED())
|
||||||
|
LIFETIME(0)
|
||||||
|
SOURCE(CLICKHOUSE(TABLE '02154_test_source_table'))
|
||||||
|
"""
|
||||||
|
|
||||||
|
echo """
|
||||||
|
SELECT dictGet(02154_test_dictionary, 'value', toUInt64(0)), dictGet(02154_test_dictionary, 'value', toUInt64(1))
|
||||||
|
FORMAT JSON
|
||||||
|
""" | ${CLICKHOUSE_CURL} -sSg "${CLICKHOUSE_URL}&wait_end_of_query=1&output_format_write_statistics=0" -d @-
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT -q "DROP DICTIONARY 02154_test_dictionary"
|
||||||
|
$CLICKHOUSE_CLIENT -q "DROP TABLE 02154_test_source_table"
|
Loading…
Reference in New Issue
Block a user