Added test [#CLICKHOUSE-2882].

This commit is contained in:
Alexey Milovidov 2017-03-12 18:54:40 +03:00
parent 870d36ed5c
commit a79eb483a2
2 changed files with 309 additions and 0 deletions

View 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

View 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;