mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Added test for pretty formats [#METR-2944].
This commit is contained in:
parent
025bfd414f
commit
de30204c00
213
dbms/tests/queries/0_stateless/00405_pretty_formats.reference
Normal file
213
dbms/tests/queries/0_stateless/00405_pretty_formats.reference
Normal file
@ -0,0 +1,213 @@
|
||||
┏━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
|
||||
┃ [1mhello[0m ┃ [1mworld[0m ┃ [1mtuple [0m ┃ [1msometimes_nulls[0m ┃
|
||||
┡━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┏━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
|
||||
┃ [1mhello[0m ┃ [1mworld[0m ┃ [1mtuple [0m ┃ [1msometimes_nulls[0m ┃
|
||||
┡━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 6 │ 6 │ (6,'6') │ \N │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 7 │ 7 │ (7,'7') │ 1 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 8 │ 8 │ (8,'8') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 9 │ 9 │ (9,'9') │ \N │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┌─[1mhello[0m─┬─[1mworld[0m─┬─[1mtuple[0m───┬─[1msometimes_nulls[0m─┐
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┌─[1mhello[0m─┬─[1mworld[0m─┬─[1mtuple[0m───┬─[1msometimes_nulls[0m─┐
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
│ 6 │ 6 │ (6,'6') │ \N │
|
||||
│ 7 │ 7 │ (7,'7') │ 1 │
|
||||
│ 8 │ 8 │ (8,'8') │ 2 │
|
||||
│ 9 │ 9 │ (9,'9') │ \N │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
[1mhello[0m [1mworld[0m [1mtuple[0m [1msometimes_nulls[0m
|
||||
|
||||
0 0 (0,'0') \N
|
||||
1 1 (1,'1') 1
|
||||
2 2 (2,'2') 2
|
||||
3 3 (3,'3') \N
|
||||
4 4 (4,'4') 1
|
||||
[1mhello[0m [1mworld[0m [1mtuple[0m [1msometimes_nulls[0m
|
||||
|
||||
5 5 (5,'5') 2
|
||||
6 6 (6,'6') \N
|
||||
7 7 (7,'7') 1
|
||||
8 8 (8,'8') 2
|
||||
9 9 (9,'9') \N
|
||||
┌─[1mhello[0m─┬─[1mworld[0m─┬─[1mtuple[0m───┬─[1msometimes_nulls[0m─┐
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
│ 6 │ 6 │ (6,'6') │ \N │
|
||||
│ 7 │ 7 │ (7,'7') │ 1 │
|
||||
│ 8 │ 8 │ (8,'8') │ 2 │
|
||||
│ 9 │ 9 │ (9,'9') │ \N │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┏━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
|
||||
┃ hello ┃ world ┃ tuple ┃ sometimes_nulls ┃
|
||||
┡━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┏━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
|
||||
┃ hello ┃ world ┃ tuple ┃ sometimes_nulls ┃
|
||||
┡━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 6 │ 6 │ (6,'6') │ \N │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 7 │ 7 │ (7,'7') │ 1 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 8 │ 8 │ (8,'8') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 9 │ 9 │ (9,'9') │ \N │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┌─hello─┬─world─┬─tuple───┬─sometimes_nulls─┐
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┌─hello─┬─world─┬─tuple───┬─sometimes_nulls─┐
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
│ 6 │ 6 │ (6,'6') │ \N │
|
||||
│ 7 │ 7 │ (7,'7') │ 1 │
|
||||
│ 8 │ 8 │ (8,'8') │ 2 │
|
||||
│ 9 │ 9 │ (9,'9') │ \N │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
hello world tuple sometimes_nulls
|
||||
|
||||
0 0 (0,'0') \N
|
||||
1 1 (1,'1') 1
|
||||
2 2 (2,'2') 2
|
||||
3 3 (3,'3') \N
|
||||
4 4 (4,'4') 1
|
||||
hello world tuple sometimes_nulls
|
||||
|
||||
5 5 (5,'5') 2
|
||||
6 6 (6,'6') \N
|
||||
7 7 (7,'7') 1
|
||||
8 8 (8,'8') 2
|
||||
9 9 (9,'9') \N
|
||||
┏━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
|
||||
┃ [1mhello[0m ┃ [1mworld[0m ┃ [1mtuple [0m ┃ [1msometimes_nulls[0m ┃
|
||||
┡━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┏━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
|
||||
┃ [1mhello[0m ┃ [1mworld[0m ┃ [1mtuple [0m ┃ [1msometimes_nulls[0m ┃
|
||||
┡━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
Showed first 6.
|
||||
┌─[1mhello[0m─┬─[1mworld[0m─┬─[1mtuple[0m───┬─[1msometimes_nulls[0m─┐
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┌─[1mhello[0m─┬─[1mworld[0m─┬─[1mtuple[0m───┬─[1msometimes_nulls[0m─┐
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
Showed first 6.
|
||||
[1mhello[0m [1mworld[0m [1mtuple[0m [1msometimes_nulls[0m
|
||||
|
||||
0 0 (0,'0') \N
|
||||
1 1 (1,'1') 1
|
||||
2 2 (2,'2') 2
|
||||
3 3 (3,'3') \N
|
||||
4 4 (4,'4') 1
|
||||
[1mhello[0m [1mworld[0m [1mtuple[0m [1msometimes_nulls[0m
|
||||
|
||||
5 5 (5,'5') 2
|
||||
|
||||
Showed first 6.
|
||||
┌─[1mhello[0m─┬─[1mworld[0m─┬─[1mtuple[0m───┬─[1msometimes_nulls[0m─┐
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
Showed first 6.
|
||||
┏━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
|
||||
┃ hello ┃ world ┃ tuple ┃ sometimes_nulls ┃
|
||||
┡━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┏━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
|
||||
┃ hello ┃ world ┃ tuple ┃ sometimes_nulls ┃
|
||||
┡━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
Showed first 6.
|
||||
┌─hello─┬─world─┬─tuple───┬─sometimes_nulls─┐
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┌─hello─┬─world─┬─tuple───┬─sometimes_nulls─┐
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
Showed first 6.
|
||||
hello world tuple sometimes_nulls
|
||||
|
||||
0 0 (0,'0') \N
|
||||
1 1 (1,'1') 1
|
||||
2 2 (2,'2') 2
|
||||
3 3 (3,'3') \N
|
||||
4 4 (4,'4') 1
|
||||
hello world tuple sometimes_nulls
|
||||
|
||||
5 5 (5,'5') 2
|
||||
|
||||
Showed first 6.
|
17
dbms/tests/queries/0_stateless/00405_pretty_formats.sql
Normal file
17
dbms/tests/queries/0_stateless/00405_pretty_formats.sql
Normal file
@ -0,0 +1,17 @@
|
||||
SELECT number AS hello, toString(number) AS world, (hello, world) AS tuple, nullIf(hello % 3, 0) AS sometimes_nulls FROM system.numbers LIMIT 10 SETTINGS max_block_size = 5 FORMAT Pretty;
|
||||
SELECT number AS hello, toString(number) AS world, (hello, world) AS tuple, nullIf(hello % 3, 0) AS sometimes_nulls FROM system.numbers LIMIT 10 SETTINGS max_block_size = 5 FORMAT PrettyCompact;
|
||||
SELECT number AS hello, toString(number) AS world, (hello, world) AS tuple, nullIf(hello % 3, 0) AS sometimes_nulls FROM system.numbers LIMIT 10 SETTINGS max_block_size = 5 FORMAT PrettySpace;
|
||||
SELECT number AS hello, toString(number) AS world, (hello, world) AS tuple, nullIf(hello % 3, 0) AS sometimes_nulls FROM system.numbers LIMIT 10 SETTINGS max_block_size = 5 FORMAT PrettyCompactMonoBlock;
|
||||
SELECT number AS hello, toString(number) AS world, (hello, world) AS tuple, nullIf(hello % 3, 0) AS sometimes_nulls FROM system.numbers LIMIT 10 SETTINGS max_block_size = 5 FORMAT PrettyNoEscapes;
|
||||
SELECT number AS hello, toString(number) AS world, (hello, world) AS tuple, nullIf(hello % 3, 0) AS sometimes_nulls FROM system.numbers LIMIT 10 SETTINGS max_block_size = 5 FORMAT PrettyCompactNoEscapes;
|
||||
SELECT number AS hello, toString(number) AS world, (hello, world) AS tuple, nullIf(hello % 3, 0) AS sometimes_nulls FROM system.numbers LIMIT 10 SETTINGS max_block_size = 5 FORMAT PrettySpaceNoEscapes;
|
||||
|
||||
SET output_format_pretty_max_rows = 6;
|
||||
|
||||
SELECT number AS hello, toString(number) AS world, (hello, world) AS tuple, nullIf(hello % 3, 0) AS sometimes_nulls FROM system.numbers LIMIT 10 SETTINGS max_block_size = 5 FORMAT Pretty;
|
||||
SELECT number AS hello, toString(number) AS world, (hello, world) AS tuple, nullIf(hello % 3, 0) AS sometimes_nulls FROM system.numbers LIMIT 10 SETTINGS max_block_size = 5 FORMAT PrettyCompact;
|
||||
SELECT number AS hello, toString(number) AS world, (hello, world) AS tuple, nullIf(hello % 3, 0) AS sometimes_nulls FROM system.numbers LIMIT 10 SETTINGS max_block_size = 5 FORMAT PrettySpace;
|
||||
SELECT number AS hello, toString(number) AS world, (hello, world) AS tuple, nullIf(hello % 3, 0) AS sometimes_nulls FROM system.numbers LIMIT 10 SETTINGS max_block_size = 5 FORMAT PrettyCompactMonoBlock;
|
||||
SELECT number AS hello, toString(number) AS world, (hello, world) AS tuple, nullIf(hello % 3, 0) AS sometimes_nulls FROM system.numbers LIMIT 10 SETTINGS max_block_size = 5 FORMAT PrettyNoEscapes;
|
||||
SELECT number AS hello, toString(number) AS world, (hello, world) AS tuple, nullIf(hello % 3, 0) AS sometimes_nulls FROM system.numbers LIMIT 10 SETTINGS max_block_size = 5 FORMAT PrettyCompactNoEscapes;
|
||||
SELECT number AS hello, toString(number) AS world, (hello, world) AS tuple, nullIf(hello % 3, 0) AS sometimes_nulls FROM system.numbers LIMIT 10 SETTINGS max_block_size = 5 FORMAT PrettySpaceNoEscapes;
|
Loading…
Reference in New Issue
Block a user