Test that JSON output statistics include the rows read in scalar subqueries

This commit is contained in:
Raúl Marín 2021-12-23 16:01:47 +01:00
parent cb22091b33
commit b71a71d7f5
2 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,50 @@
#1
{
"meta":
[
{
"name": "count()",
"type": "UInt64"
}
],
"data":
[
{
"count()": "100"
}
],
"rows": 1,
"rows_before_limit_at_least": 100,
"statistics":
{
"rows_read": 100,
"bytes_read": 800
}
}
#2
{
"meta":
[
{
"type": "Tuple(UInt64, UInt64)"
}
],
"data":
[
{
}
],
"rows": 1,
"statistics":
{
"rows_read": 131011,
"bytes_read": 1048081
}
}

View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
# Ref: https://github.com/ClickHouse/ClickHouse/issues/1576
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
echo "#1"
${CLICKHOUSE_CLIENT} --query='SELECT count() FROM numbers(100) FORMAT JSON;' | grep -a -v "elapsed"
echo "#2"
${CLICKHOUSE_CLIENT} --query='SELECT (SELECT max(number), count(number) FROM numbers(100000) as n) FORMAT JSON;' | grep -a -v "elapsed" | grep -v "_subquery"