mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Added a test #5614
This commit is contained in:
parent
a1cfdf2a60
commit
99334d0451
57
dbms/tests/queries/0_stateless/00963_achimbab.reference
Normal file
57
dbms/tests/queries/0_stateless/00963_achimbab.reference
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
"meta":
|
||||
[
|
||||
{
|
||||
"name": "total",
|
||||
"type": "Nullable(UInt8)"
|
||||
},
|
||||
{
|
||||
"name": "arrayElement(k, 1)",
|
||||
"type": "Nullable(UInt16)"
|
||||
},
|
||||
{
|
||||
"name": "arrayElement(k, 2)",
|
||||
"type": "Nullable(UInt16)"
|
||||
}
|
||||
],
|
||||
|
||||
"data":
|
||||
[
|
||||
{
|
||||
"total": 1,
|
||||
"arrayElement(k, 1)": null,
|
||||
"arrayElement(k, 2)": 4
|
||||
},
|
||||
{
|
||||
"total": 1,
|
||||
"arrayElement(k, 1)": null,
|
||||
"arrayElement(k, 2)": 2
|
||||
},
|
||||
{
|
||||
"total": 1,
|
||||
"arrayElement(k, 1)": null,
|
||||
"arrayElement(k, 2)": 1
|
||||
},
|
||||
{
|
||||
"total": 1,
|
||||
"arrayElement(k, 1)": null,
|
||||
"arrayElement(k, 2)": 3
|
||||
},
|
||||
{
|
||||
"total": 1,
|
||||
"arrayElement(k, 1)": null,
|
||||
"arrayElement(k, 2)": 5
|
||||
}
|
||||
],
|
||||
|
||||
"totals":
|
||||
{
|
||||
"total": 1,
|
||||
"arrayElement(k, 1)": null,
|
||||
"arrayElement(k, 2)": null
|
||||
},
|
||||
|
||||
"rows": 5,
|
||||
|
||||
"rows_before_limit_at_least": 5
|
||||
}
|
18
dbms/tests/queries/0_stateless/00963_achimbab.sql
Normal file
18
dbms/tests/queries/0_stateless/00963_achimbab.sql
Normal file
@ -0,0 +1,18 @@
|
||||
SET output_format_write_statistics = 0;
|
||||
|
||||
select
|
||||
sum(cnt) > 0 as total,
|
||||
k[1], k[2]
|
||||
from
|
||||
(
|
||||
select
|
||||
arrayMap( x -> x % 3 ? toNullable(number%5 + x) : null, range(3)) as k,
|
||||
number % 4 ? toNullable( rand() ) : Null as cnt
|
||||
from system.numbers_mt
|
||||
where number < 1000000
|
||||
limit 1000000
|
||||
)
|
||||
group by k with totals
|
||||
order by total desc
|
||||
SETTINGS max_threads = 100, max_execution_time = 120
|
||||
format JSON;
|
Loading…
Reference in New Issue
Block a user