Better row numbers

This commit is contained in:
Alexey Milovidov 2024-03-23 03:10:14 +01:00
parent e334c847fd
commit 465b0c16cd
5 changed files with 20 additions and 7 deletions

View File

@ -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);

View File

@ -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 ?

View File

@ -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)
{

View File

@ -1,3 +1,5 @@
SET output_format_pretty_row_numbers = 0;
SELECT
neighbor(n, -2) AS int,
neighbor(s, -2) AS str,

View File

@ -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