mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Added test [#CLICKHOUSE-2882].
This commit is contained in:
parent
870d36ed5c
commit
a79eb483a2
270
dbms/tests/queries/0_stateless/00437_nulls_first_last.reference
Normal file
270
dbms/tests/queries/0_stateless/00437_nulls_first_last.reference
Normal file
@ -0,0 +1,270 @@
|
||||
1
|
||||
2
|
||||
4
|
||||
7
|
||||
8
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
1
|
||||
2
|
||||
4
|
||||
7
|
||||
8
|
||||
1
|
||||
2
|
||||
4
|
||||
7
|
||||
8
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
\N
|
||||
\N
|
||||
8
|
||||
7
|
||||
4
|
||||
2
|
||||
1
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
8
|
||||
7
|
||||
4
|
||||
2
|
||||
1
|
||||
8
|
||||
7
|
||||
4
|
||||
2
|
||||
1
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
\N
|
||||
\N
|
||||
1 1
|
||||
2 2
|
||||
3 nan
|
||||
4 4
|
||||
6 nan
|
||||
7 7
|
||||
8 8
|
||||
9 nan
|
||||
\N 5
|
||||
\N nan
|
||||
1 1
|
||||
2 2
|
||||
3 nan
|
||||
4 4
|
||||
6 nan
|
||||
7 7
|
||||
8 8
|
||||
9 nan
|
||||
\N nan
|
||||
\N 5
|
||||
\N nan
|
||||
\N 5
|
||||
9 nan
|
||||
8 8
|
||||
7 7
|
||||
6 nan
|
||||
4 4
|
||||
3 nan
|
||||
2 2
|
||||
1 1
|
||||
1
|
||||
2
|
||||
4
|
||||
7
|
||||
8
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
1
|
||||
2
|
||||
4
|
||||
7
|
||||
8
|
||||
1
|
||||
2
|
||||
4
|
||||
7
|
||||
8
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
\N
|
||||
\N
|
||||
8
|
||||
7
|
||||
4
|
||||
2
|
||||
1
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
8
|
||||
7
|
||||
4
|
||||
2
|
||||
1
|
||||
8
|
||||
7
|
||||
4
|
||||
2
|
||||
1
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
\N
|
||||
\N
|
||||
1 1
|
||||
2 2
|
||||
3 nan
|
||||
4 4
|
||||
6 nan
|
||||
7 7
|
||||
8 8
|
||||
9 nan
|
||||
\N 5
|
||||
\N nan
|
||||
1 1
|
||||
2 2
|
||||
3 nan
|
||||
4 4
|
||||
6 nan
|
||||
7 7
|
||||
8 8
|
||||
9 nan
|
||||
\N nan
|
||||
\N 5
|
||||
\N nan
|
||||
\N 5
|
||||
9 nan
|
||||
8 8
|
||||
7 7
|
||||
6 nan
|
||||
4 4
|
||||
3 nan
|
||||
2 2
|
||||
1 1
|
||||
1
|
||||
2
|
||||
4
|
||||
7
|
||||
8
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
1
|
||||
2
|
||||
4
|
||||
7
|
||||
8
|
||||
1
|
||||
2
|
||||
4
|
||||
7
|
||||
8
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
\N
|
||||
\N
|
||||
8
|
||||
7
|
||||
4
|
||||
2
|
||||
1
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
8
|
||||
7
|
||||
4
|
||||
2
|
||||
1
|
||||
8
|
||||
7
|
||||
4
|
||||
2
|
||||
1
|
||||
nan
|
||||
nan
|
||||
nan
|
||||
\N
|
||||
\N
|
||||
1 1
|
||||
2 2
|
||||
3 nan
|
||||
4 4
|
||||
6 nan
|
||||
7 7
|
||||
8 8
|
||||
9 nan
|
||||
\N 5
|
||||
\N nan
|
||||
1 1
|
||||
2 2
|
||||
3 nan
|
||||
4 4
|
||||
6 nan
|
||||
7 7
|
||||
8 8
|
||||
9 nan
|
||||
\N nan
|
||||
\N 5
|
||||
\N nan
|
||||
\N 5
|
||||
9 nan
|
||||
8 8
|
||||
7 7
|
||||
6 nan
|
||||
4 4
|
||||
3 nan
|
||||
2 2
|
||||
1 1
|
39
dbms/tests/queries/0_stateless/00437_nulls_first_last.sql
Normal file
39
dbms/tests/queries/0_stateless/00437_nulls_first_last.sql
Normal file
@ -0,0 +1,39 @@
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x ASC;
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x ASC NULLS FIRST;
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x ASC NULLS LAST;
|
||||
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x DESC;
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x DESC NULLS FIRST;
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x DESC NULLS LAST;
|
||||
|
||||
SELECT x, y FROM (SELECT number % 5 = 0 ? NULL : number AS x, number % 3 = 0 ? nan : toFloat64(number) AS y FROM system.numbers LIMIT 10) ORDER BY x ASC, y ASC;
|
||||
SELECT x, y FROM (SELECT number % 5 = 0 ? NULL : number AS x, number % 3 = 0 ? nan : toFloat64(number) AS y FROM system.numbers LIMIT 10) ORDER BY x ASC, y ASC NULLS FIRST;
|
||||
SELECT x, y FROM (SELECT number % 5 = 0 ? NULL : number AS x, number % 3 = 0 ? nan : toFloat64(number) AS y FROM system.numbers LIMIT 10) ORDER BY x DESC NULLS FIRST, y ASC NULLS FIRST;
|
||||
|
||||
SET max_block_size = 5;
|
||||
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x ASC;
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x ASC NULLS FIRST;
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x ASC NULLS LAST;
|
||||
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x DESC;
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x DESC NULLS FIRST;
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x DESC NULLS LAST;
|
||||
|
||||
SELECT x, y FROM (SELECT number % 5 = 0 ? NULL : number AS x, number % 3 = 0 ? nan : toFloat64(number) AS y FROM system.numbers LIMIT 10) ORDER BY x ASC, y ASC;
|
||||
SELECT x, y FROM (SELECT number % 5 = 0 ? NULL : number AS x, number % 3 = 0 ? nan : toFloat64(number) AS y FROM system.numbers LIMIT 10) ORDER BY x ASC, y ASC NULLS FIRST;
|
||||
SELECT x, y FROM (SELECT number % 5 = 0 ? NULL : number AS x, number % 3 = 0 ? nan : toFloat64(number) AS y FROM system.numbers LIMIT 10) ORDER BY x DESC NULLS FIRST, y ASC NULLS FIRST;
|
||||
|
||||
SET max_block_size = 3;
|
||||
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x ASC;
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x ASC NULLS FIRST;
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x ASC NULLS LAST;
|
||||
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x DESC;
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x DESC NULLS FIRST;
|
||||
SELECT x FROM (SELECT number % 5 = 0 ? NULL : (number % 3 = 0 ? nan : toFloat64(number)) AS x FROM system.numbers LIMIT 10) ORDER BY x DESC NULLS LAST;
|
||||
|
||||
SELECT x, y FROM (SELECT number % 5 = 0 ? NULL : number AS x, number % 3 = 0 ? nan : toFloat64(number) AS y FROM system.numbers LIMIT 10) ORDER BY x ASC, y ASC;
|
||||
SELECT x, y FROM (SELECT number % 5 = 0 ? NULL : number AS x, number % 3 = 0 ? nan : toFloat64(number) AS y FROM system.numbers LIMIT 10) ORDER BY x ASC, y ASC NULLS FIRST;
|
||||
SELECT x, y FROM (SELECT number % 5 = 0 ? NULL : number AS x, number % 3 = 0 ? nan : toFloat64(number) AS y FROM system.numbers LIMIT 10) ORDER BY x DESC NULLS FIRST, y ASC NULLS FIRST;
|
Loading…
Reference in New Issue
Block a user