mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 03:52:15 +00:00
Add stateless test for JSONCompactWithProgress output format
This commit is contained in:
parent
ef4ad01d7d
commit
f3710e9a29
@ -0,0 +1,14 @@
|
|||||||
|
1
|
||||||
|
{"meta": [{"name":"value", "type":"UInt8"}, {"name":"name", "type":"String"}]}}
|
||||||
|
{"data":[1, "a"]}
|
||||||
|
{"data":[2, "b"]}
|
||||||
|
{"data":[3, "c"]}
|
||||||
|
{"progress":{"read_rows":"3","read_bytes":"33","written_rows":"0","written_bytes":"0","total_rows_to_read":"3","result_rows":"0","result_bytes":"0","elapsed_ns":"ELAPSED_NS"}}
|
||||||
|
{"statistics": {"rows":3, "elapsed":ELAPSED, "rows_read":3, "bytes_read":33}}
|
||||||
|
2
|
||||||
|
{"meta": [{"name":"name", "type":"String"}, {"name":"c", "type":"UInt64"}]}}
|
||||||
|
{"data":["a", "1"]}
|
||||||
|
{"data":["b", "1"]}
|
||||||
|
{"data":["c", "1"]}
|
||||||
|
{"totals": ["", "3"]}}
|
||||||
|
{"statistics": {"rows":3, "elapsed":ELAPSED, "rows_read":3, "bytes_read":30}}
|
20
tests/queries/0_stateless/03174_json_compact_with_progress.sh
Executable file
20
tests/queries/0_stateless/03174_json_compact_with_progress.sh
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Tags: no-fasttest, no-parallel
|
||||||
|
|
||||||
|
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
# shellcheck source=../shell_config.sh
|
||||||
|
. "$CUR_DIR"/../shell_config.sh
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS test_table;"
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT -q "SELECT 1;"
|
||||||
|
# Check JSONCompactWithProgress Output
|
||||||
|
$CLICKHOUSE_CLIENT -q "CREATE TABLE test_table (value UInt8, name String) ENGINE = MergeTree() ORDER BY value;"
|
||||||
|
$CLICKHOUSE_CLIENT -q "INSERT INTO test_table VALUES (1, 'a'), (2, 'b'), (3, 'c');"
|
||||||
|
$CLICKHOUSE_CLIENT -q "SELECT * FROM test_table FORMAT JSONCompactWithProgress settings max_block_size=2;" | sed -E 's/"elapsed_ns":"[0-9]+"/"elapsed_ns":"ELAPSED_NS"/g; s/"elapsed":[0-9]+\.[0-9]+/"elapsed":ELAPSED/g'
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT -q "SELECT 2;"
|
||||||
|
# Check Totals
|
||||||
|
$CLICKHOUSE_CLIENT -q "SELECT name, count() AS c FROM test_table GROUP BY name WITH TOTALS ORDER BY name FORMAT JSONCompactWithProgress settings max_block_size=2;" | sed -E 's/"elapsed_ns":"[0-9]+"/"elapsed_ns":"ELAPSED_NS"/g; s/"elapsed":[0-9]+\.[0-9]+/"elapsed":ELAPSED/g'
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS test_table;"
|
Loading…
Reference in New Issue
Block a user