mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 18:42:26 +00:00
Better row numbers
This commit is contained in:
parent
e334c847fd
commit
465b0c16cd
@ -287,11 +287,14 @@ void PrettyBlockOutputFormat::writeChunk(const Chunk & chunk, PortKind port_kind
|
||||
{
|
||||
// Write row number;
|
||||
auto row_num_string = std::to_string(i + 1 + total_rows) + ". ";
|
||||
|
||||
for (size_t j = 0; j < row_number_width - row_num_string.size(); ++j)
|
||||
{
|
||||
writeCString(" ", out);
|
||||
}
|
||||
writeChar(' ', out);
|
||||
if (color)
|
||||
writeCString("\033[90m", out);
|
||||
writeString(row_num_string, out);
|
||||
if (color)
|
||||
writeCString("\033[0m", out);
|
||||
}
|
||||
|
||||
writeCString(grid_symbols.bar, out);
|
||||
|
@ -147,10 +147,12 @@ void PrettyCompactBlockOutputFormat::writeRow(
|
||||
// Write row number;
|
||||
auto row_num_string = std::to_string(row_num + 1 + total_rows) + ". ";
|
||||
for (size_t i = 0; i < row_number_width - row_num_string.size(); ++i)
|
||||
{
|
||||
writeCString(" ", out);
|
||||
}
|
||||
writeChar(' ', out);
|
||||
if (color)
|
||||
writeCString("\033[90m", out);
|
||||
writeString(row_num_string, out);
|
||||
if (color)
|
||||
writeCString("\033[0m", out);
|
||||
}
|
||||
|
||||
const GridSymbols & grid_symbols = format_settings.pretty.charset == FormatSettings::Pretty::Charset::UTF8 ?
|
||||
|
@ -73,8 +73,13 @@ void PrettySpaceBlockOutputFormat::writeChunk(const Chunk & chunk, PortKind port
|
||||
// Write row number;
|
||||
auto row_num_string = std::to_string(row + 1 + total_rows) + ". ";
|
||||
for (size_t i = 0; i < row_number_width - row_num_string.size(); ++i)
|
||||
writeCString(" ", out);
|
||||
writeChar(' ', out);
|
||||
if (color)
|
||||
writeCString("\033[90m", out);
|
||||
writeString(row_num_string, out);
|
||||
if (color)
|
||||
writeCString("\033[0m", out);
|
||||
|
||||
}
|
||||
for (size_t column = 0; column < num_columns; ++column)
|
||||
{
|
||||
|
@ -1,3 +1,5 @@
|
||||
SET output_format_pretty_row_numbers = 0;
|
||||
|
||||
SELECT
|
||||
neighbor(n, -2) AS int,
|
||||
neighbor(s, -2) AS str,
|
||||
|
@ -1,5 +1,6 @@
|
||||
DROP TABLE IF EXISTS t_merge_tree_index;
|
||||
|
||||
SET output_format_pretty_row_numbers = 0;
|
||||
SET print_pretty_type_names = 0;
|
||||
|
||||
CREATE TABLE t_merge_tree_index
|
||||
|
Loading…
Reference in New Issue
Block a user