mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
add test for json defaults over http
This commit is contained in:
parent
d6d83d4a5c
commit
6e2d23444f
@ -0,0 +1,6 @@
|
||||
{"x":0,"y":0,"a":"6","b":6,"c":6}
|
||||
{"x":0,"y":5,"a":"5","b":1.7917595,"c":5}
|
||||
{"x":1,"y":1,"a":"2","b":1.0986123,"c":42}
|
||||
{"x":2,"y":2,"a":"4","b":1.609438,"c":2}
|
||||
{"x":3,"y":3,"a":"3","b":3,"c":3}
|
||||
{"x":4,"y":0,"a":"4","b":1.609438,"c":42}
|
15
dbms/tests/queries/0_stateless/00851_http_insert_json_defaults.sh
Executable file
15
dbms/tests/queries/0_stateless/00851_http_insert_json_defaults.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. $CURDIR/../shell_config.sh
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS test.defaults"
|
||||
$CLICKHOUSE_CLIENT --query="CREATE TABLE test.defaults (x UInt32, y UInt32, a DEFAULT x + y, b Float32 DEFAULT log(1 + x + y), c UInt32 DEFAULT 42, e MATERIALIZED x + y, f ALIAS x + y) ENGINE = Memory"
|
||||
|
||||
echo -ne '{"x":1, "y":1}\n' | ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}?query=INSERT%20INTO%20test.defaults%20FORMAT%20JSONEachRow%20SETTINGS%20insert_sample_with_metadata=1" --data-binary @-
|
||||
echo -ne '{"x":2, "y":2, "c":2}\n' | ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}?query=INSERT+INTO+test.defaults+FORMAT+JSONEachRow+SETTINGS+insert_sample_with_metadata=1" --data-binary @-
|
||||
echo -ne '{"x":3, "y":3, "a":3, "b":3, "c":3}\n' | ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}?query=INSERT+INTO+test.defaults+FORMAT+JSONEachRow+SETTINGS+insert_sample_with_metadata=1" --data-binary @-
|
||||
echo -ne '{"x":4} {"y":5, "c":5} {"a":6, "b":6, "c":6}\n' | ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}?query=INSERT+INTO+test.defaults+FORMAT+JSONEachRow+SETTINGS+insert_sample_with_metadata=1" --data-binary @-
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="SELECT * FROM test.defaults ORDER BY x, y FORMAT JSONEachRow"
|
||||
$CLICKHOUSE_CLIENT --query="DROP TABLE test.defaults"
|
Loading…
Reference in New Issue
Block a user