mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Remove escaping in presentational formats (#2476)
* Removed escaping in presentational formats; changed a way how NULL is output #1729 * Addition to prev. revision #1729 * Addition to prev. revision #1729 * Updated tests #1729 * Updated function visibleWidth to be consistent with Pretty formats #1729
This commit is contained in:
parent
095420e158
commit
be4be0758a
@ -119,7 +119,6 @@ BlockInputStreamPtr FormatFactory::getInput(const String & name, ReadBuffer & bu
|
||||
|| name == "PrettyCompactNoEscapes"
|
||||
|| name == "PrettySpaceNoEscapes"
|
||||
|| name == "Vertical"
|
||||
|| name == "VerticalRaw"
|
||||
|| name == "Null"
|
||||
|| name == "JSON"
|
||||
|| name == "JSONCompact"
|
||||
@ -180,9 +179,6 @@ static BlockOutputStreamPtr getOutputImpl(const String & name, WriteBuffer & buf
|
||||
else if (name == "Vertical")
|
||||
return std::make_shared<BlockOutputStreamFromRowOutputStream>(std::make_shared<VerticalRowOutputStream>(
|
||||
buf, sample, settings.output_format_pretty_max_rows), sample);
|
||||
else if (name == "VerticalRaw")
|
||||
return std::make_shared<BlockOutputStreamFromRowOutputStream>(std::make_shared<VerticalRawRowOutputStream>(
|
||||
buf, sample, settings.output_format_pretty_max_rows), sample);
|
||||
else if (name == "Values")
|
||||
return std::make_shared<BlockOutputStreamFromRowOutputStream>(std::make_shared<ValuesRowOutputStream>(buf), sample);
|
||||
else if (name == "JSON")
|
||||
|
@ -55,7 +55,7 @@ void PrettyBlockOutputStream::calculateWidths(const Block & block, WidthsPerColu
|
||||
{
|
||||
{
|
||||
WriteBufferFromString out(serialized_value);
|
||||
elem.type->serializeTextEscaped(*elem.column, j, out);
|
||||
elem.type->serializeText(*elem.column, j, out);
|
||||
}
|
||||
|
||||
widths[i][j] = UTF8::countCodePoints(reinterpret_cast<const UInt8 *>(serialized_value.data()), serialized_value.size());
|
||||
@ -64,13 +64,7 @@ void PrettyBlockOutputStream::calculateWidths(const Block & block, WidthsPerColu
|
||||
|
||||
/// And also calculate widths for names of columns.
|
||||
{
|
||||
/// We need to obtain length in escaped form.
|
||||
{
|
||||
WriteBufferFromString out(serialized_value);
|
||||
writeEscapedString(elem.name, out);
|
||||
}
|
||||
|
||||
name_widths[i] = UTF8::countCodePoints(reinterpret_cast<const UInt8 *>(serialized_value.data()), serialized_value.size());
|
||||
name_widths[i] = UTF8::countCodePoints(reinterpret_cast<const UInt8 *>(elem.name.data()), elem.name.size());
|
||||
max_widths[i] = std::max(max_widths[i], name_widths[i]);
|
||||
}
|
||||
}
|
||||
@ -151,11 +145,11 @@ void PrettyBlockOutputStream::write(const Block & block)
|
||||
for (size_t k = 0; k < max_widths[i] - name_widths[i]; ++k)
|
||||
writeChar(' ', ostr);
|
||||
|
||||
writeEscapedString(col.name, ostr);
|
||||
writeString(col.name, ostr);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeEscapedString(col.name, ostr);
|
||||
writeString(col.name, ostr);
|
||||
|
||||
for (size_t k = 0; k < max_widths[i] - name_widths[i]; ++k)
|
||||
writeChar(' ', ostr);
|
||||
@ -203,11 +197,11 @@ void PrettyBlockOutputStream::writeValueWithPadding(const ColumnWithTypeAndName
|
||||
if (elem.type->shouldAlignRightInPrettyFormats())
|
||||
{
|
||||
writePadding();
|
||||
elem.type->serializeTextEscaped(*elem.column.get(), row_num, ostr);
|
||||
elem.type->serializeText(*elem.column.get(), row_num, ostr);
|
||||
}
|
||||
else
|
||||
{
|
||||
elem.type->serializeTextEscaped(*elem.column.get(), row_num, ostr);
|
||||
elem.type->serializeText(*elem.column.get(), row_num, ostr);
|
||||
writePadding();
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ void PrettyCompactBlockOutputStream::writeHeader(
|
||||
|
||||
if (!no_escapes)
|
||||
writeCString("\033[1m", ostr);
|
||||
writeEscapedString(col.name, ostr);
|
||||
writeString(col.name, ostr);
|
||||
if (!no_escapes)
|
||||
writeCString("\033[0m", ostr);
|
||||
}
|
||||
@ -42,7 +42,7 @@ void PrettyCompactBlockOutputStream::writeHeader(
|
||||
{
|
||||
if (!no_escapes)
|
||||
writeCString("\033[1m", ostr);
|
||||
writeEscapedString(col.name, ostr);
|
||||
writeString(col.name, ostr);
|
||||
if (!no_escapes)
|
||||
writeCString("\033[0m", ostr);
|
||||
|
||||
|
@ -44,7 +44,7 @@ void PrettySpaceBlockOutputStream::write(const Block & block)
|
||||
|
||||
if (!no_escapes)
|
||||
writeCString("\033[1m", ostr);
|
||||
writeEscapedString(col.name, ostr);
|
||||
writeString(col.name, ostr);
|
||||
if (!no_escapes)
|
||||
writeCString("\033[0m", ostr);
|
||||
}
|
||||
@ -52,7 +52,7 @@ void PrettySpaceBlockOutputStream::write(const Block & block)
|
||||
{
|
||||
if (!no_escapes)
|
||||
writeCString("\033[1m", ostr);
|
||||
writeEscapedString(col.name, ostr);
|
||||
writeString(col.name, ostr);
|
||||
if (!no_escapes)
|
||||
writeCString("\033[0m", ostr);
|
||||
|
||||
|
@ -26,13 +26,7 @@ VerticalRowOutputStream::VerticalRowOutputStream(
|
||||
/// Note that number of code points is just a rough approximation of visible string width.
|
||||
const String & name = sample.getByPosition(i).name;
|
||||
|
||||
{
|
||||
/// We need to obtain length in escaped form.
|
||||
WriteBufferFromString out(serialized_value);
|
||||
writeEscapedString(name, out);
|
||||
}
|
||||
|
||||
name_widths[i] = UTF8::countCodePoints(reinterpret_cast<const UInt8 *>(serialized_value.data()), serialized_value.size());
|
||||
name_widths[i] = UTF8::countCodePoints(reinterpret_cast<const UInt8 *>(name.data()), name.size());
|
||||
|
||||
if (name_widths[i] > max_name_width)
|
||||
max_name_width = name_widths[i];
|
||||
@ -42,7 +36,7 @@ VerticalRowOutputStream::VerticalRowOutputStream(
|
||||
for (size_t i = 0; i < columns; ++i)
|
||||
{
|
||||
WriteBufferFromString out(names_and_paddings[i]);
|
||||
writeEscapedString(sample.getByPosition(i).name, out);
|
||||
writeString(sample.getByPosition(i).name, out);
|
||||
writeCString(": ", out);
|
||||
}
|
||||
|
||||
@ -71,11 +65,6 @@ void VerticalRowOutputStream::writeField(const IColumn & column, const IDataType
|
||||
|
||||
|
||||
void VerticalRowOutputStream::writeValue(const IColumn & column, const IDataType & type, size_t row_num) const
|
||||
{
|
||||
type.serializeTextEscaped(column, row_num, ostr);
|
||||
}
|
||||
|
||||
void VerticalRawRowOutputStream::writeValue(const IColumn & column, const IDataType & type, size_t row_num) const
|
||||
{
|
||||
type.serializeText(column, row_num, ostr);
|
||||
}
|
||||
|
@ -51,17 +51,5 @@ protected:
|
||||
Block extremes;
|
||||
};
|
||||
|
||||
|
||||
/** Same but values are printed without escaping.
|
||||
*/
|
||||
class VerticalRawRowOutputStream final : public VerticalRowOutputStream
|
||||
{
|
||||
public:
|
||||
using VerticalRowOutputStream::VerticalRowOutputStream;
|
||||
|
||||
protected:
|
||||
void writeValue(const IColumn & column, const IDataType & type, size_t row_num) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
@ -242,8 +242,14 @@ void DataTypeNullable::serializeText(const IColumn & column, size_t row_num, Wri
|
||||
{
|
||||
const ColumnNullable & col = static_cast<const ColumnNullable &>(column);
|
||||
|
||||
/// In simple text format (like 'Pretty' format) (these formats are suitable only for output and cannot be parsed back),
|
||||
/// data is printed without escaping.
|
||||
/// It makes theoretically impossible to distinguish between NULL and some string value, regardless on how do we print NULL.
|
||||
/// For this reason, we output NULL in a bit strange way.
|
||||
/// This assumes UTF-8 and proper font support. This is Ok, because Pretty formats are "presentational", not for data exchange.
|
||||
|
||||
if (col.isNullAt(row_num))
|
||||
writeCString("NULL", ostr);
|
||||
writeCString("ᴺᵁᴸᴸ", ostr);
|
||||
else
|
||||
nested_data_type->serializeText(col.getNestedColumn(), row_num, ostr);
|
||||
}
|
||||
|
@ -1688,7 +1688,7 @@ void FunctionVisibleWidth::executeImpl(Block & block, const ColumnNumbers & argu
|
||||
{
|
||||
{
|
||||
WriteBufferFromString out(tmp);
|
||||
src.type->serializeTextEscaped(*src.column, i, out);
|
||||
src.type->serializeText(*src.column, i, out);
|
||||
}
|
||||
|
||||
res_data[i] = UTF8::countCodePoints(reinterpret_cast<const UInt8 *>(tmp.data()), tmp.size());
|
||||
|
@ -1,7 +1,4 @@
|
||||
Row 1:
|
||||
──────
|
||||
x: a\tb\nc\td
|
||||
Row 1:
|
||||
──────
|
||||
x: a b
|
||||
c d
|
||||
|
@ -1,2 +1 @@
|
||||
SELECT 'a\tb\nc\td' AS x FORMAT Vertical;
|
||||
SELECT 'a\tb\nc\td' AS x FORMAT VerticalRaw;
|
||||
|
@ -3,15 +3,15 @@
|
||||
└───────┴───┘
|
||||
┌─[1mx[0m─────┬─[1my[0m─┐
|
||||
│ Hello │ 0 │
|
||||
│ \\ │ 0 │
|
||||
│ \ │ 0 │
|
||||
└───────┴───┘
|
||||
┌─[1mx[0m─────┬─[1my[0m─┐
|
||||
│ Hello │ 0 │
|
||||
│ \\ │ 0 │
|
||||
│ \t\\t │ 0 │
|
||||
│ \ │ 0 │
|
||||
│ \t │ 0 │
|
||||
└───────┴───┘
|
||||
┌─[1mx[0m─────┬─[1my[0m─┬─[1mtoInt8(x)[0m─┬─[1ms[0m─────┬─[1mcasted[0m─┐
|
||||
│ Hello │ 0 │ -100 │ Hello │ Hello │
|
||||
│ \\ │ 0 │ 0 │ \\ │ \\ │
|
||||
│ \t\\t │ 0 │ 111 │ \t\\t │ \t\\t │
|
||||
│ \ │ 0 │ 0 │ \ │ \ │
|
||||
│ \t │ 0 │ 111 │ \t │ \t │
|
||||
└───────┴───┴───────────┴───────┴────────┘
|
||||
|
@ -1,13 +1,13 @@
|
||||
┏━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
|
||||
┃ [1mhello[0m ┃ [1mworld[0m ┃ [1mtuple [0m ┃ [1msometimes_nulls[0m ┃
|
||||
┡━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 0 │ 0 │ (0,'0') │ ᴺᵁᴸᴸ │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 3 │ 3 │ (3,'3') │ ᴺᵁᴸᴸ │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
@ -16,64 +16,64 @@
|
||||
┡━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 6 │ 6 │ (6,'6') │ \N │
|
||||
│ 6 │ 6 │ (6,'6') │ ᴺᵁᴸᴸ │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 7 │ 7 │ (7,'7') │ 1 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 8 │ 8 │ (8,'8') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 9 │ 9 │ (9,'9') │ \N │
|
||||
│ 9 │ 9 │ (9,'9') │ ᴺᵁᴸᴸ │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┌─[1mhello[0m─┬─[1mworld[0m─┬─[1mtuple[0m───┬─[1msometimes_nulls[0m─┐
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 0 │ 0 │ (0,'0') │ ᴺᵁᴸᴸ │
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 3 │ 3 │ (3,'3') │ ᴺᵁᴸᴸ │
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┌─[1mhello[0m─┬─[1mworld[0m─┬─[1mtuple[0m───┬─[1msometimes_nulls[0m─┐
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
│ 6 │ 6 │ (6,'6') │ \N │
|
||||
│ 6 │ 6 │ (6,'6') │ ᴺᵁᴸᴸ │
|
||||
│ 7 │ 7 │ (7,'7') │ 1 │
|
||||
│ 8 │ 8 │ (8,'8') │ 2 │
|
||||
│ 9 │ 9 │ (9,'9') │ \N │
|
||||
│ 9 │ 9 │ (9,'9') │ ᴺᵁᴸᴸ │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
[1mhello[0m [1mworld[0m [1mtuple[0m [1msometimes_nulls[0m
|
||||
|
||||
0 0 (0,'0') \N
|
||||
0 0 (0,'0') ᴺᵁᴸᴸ
|
||||
1 1 (1,'1') 1
|
||||
2 2 (2,'2') 2
|
||||
3 3 (3,'3') \N
|
||||
3 3 (3,'3') ᴺᵁᴸᴸ
|
||||
4 4 (4,'4') 1
|
||||
[1mhello[0m [1mworld[0m [1mtuple[0m [1msometimes_nulls[0m
|
||||
|
||||
5 5 (5,'5') 2
|
||||
6 6 (6,'6') \N
|
||||
6 6 (6,'6') ᴺᵁᴸᴸ
|
||||
7 7 (7,'7') 1
|
||||
8 8 (8,'8') 2
|
||||
9 9 (9,'9') \N
|
||||
9 9 (9,'9') ᴺᵁᴸᴸ
|
||||
┌─[1mhello[0m─┬─[1mworld[0m─┬─[1mtuple[0m───┬─[1msometimes_nulls[0m─┐
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 0 │ 0 │ (0,'0') │ ᴺᵁᴸᴸ │
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 3 │ 3 │ (3,'3') │ ᴺᵁᴸᴸ │
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
│ 6 │ 6 │ (6,'6') │ \N │
|
||||
│ 6 │ 6 │ (6,'6') │ ᴺᵁᴸᴸ │
|
||||
│ 7 │ 7 │ (7,'7') │ 1 │
|
||||
│ 8 │ 8 │ (8,'8') │ 2 │
|
||||
│ 9 │ 9 │ (9,'9') │ \N │
|
||||
│ 9 │ 9 │ (9,'9') │ ᴺᵁᴸᴸ │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┏━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
|
||||
┃ hello ┃ world ┃ tuple ┃ sometimes_nulls ┃
|
||||
┡━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 0 │ 0 │ (0,'0') │ ᴺᵁᴸᴸ │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 3 │ 3 │ (3,'3') │ ᴺᵁᴸᴸ │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
@ -82,52 +82,52 @@
|
||||
┡━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 6 │ 6 │ (6,'6') │ \N │
|
||||
│ 6 │ 6 │ (6,'6') │ ᴺᵁᴸᴸ │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 7 │ 7 │ (7,'7') │ 1 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 8 │ 8 │ (8,'8') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 9 │ 9 │ (9,'9') │ \N │
|
||||
│ 9 │ 9 │ (9,'9') │ ᴺᵁᴸᴸ │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┌─hello─┬─world─┬─tuple───┬─sometimes_nulls─┐
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 0 │ 0 │ (0,'0') │ ᴺᵁᴸᴸ │
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 3 │ 3 │ (3,'3') │ ᴺᵁᴸᴸ │
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┌─hello─┬─world─┬─tuple───┬─sometimes_nulls─┐
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
│ 6 │ 6 │ (6,'6') │ \N │
|
||||
│ 6 │ 6 │ (6,'6') │ ᴺᵁᴸᴸ │
|
||||
│ 7 │ 7 │ (7,'7') │ 1 │
|
||||
│ 8 │ 8 │ (8,'8') │ 2 │
|
||||
│ 9 │ 9 │ (9,'9') │ \N │
|
||||
│ 9 │ 9 │ (9,'9') │ ᴺᵁᴸᴸ │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
hello world tuple sometimes_nulls
|
||||
|
||||
0 0 (0,'0') \N
|
||||
0 0 (0,'0') ᴺᵁᴸᴸ
|
||||
1 1 (1,'1') 1
|
||||
2 2 (2,'2') 2
|
||||
3 3 (3,'3') \N
|
||||
3 3 (3,'3') ᴺᵁᴸᴸ
|
||||
4 4 (4,'4') 1
|
||||
hello world tuple sometimes_nulls
|
||||
|
||||
5 5 (5,'5') 2
|
||||
6 6 (6,'6') \N
|
||||
6 6 (6,'6') ᴺᵁᴸᴸ
|
||||
7 7 (7,'7') 1
|
||||
8 8 (8,'8') 2
|
||||
9 9 (9,'9') \N
|
||||
9 9 (9,'9') ᴺᵁᴸᴸ
|
||||
┏━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
|
||||
┃ [1mhello[0m ┃ [1mworld[0m ┃ [1mtuple [0m ┃ [1msometimes_nulls[0m ┃
|
||||
┡━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 0 │ 0 │ (0,'0') │ ᴺᵁᴸᴸ │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 3 │ 3 │ (3,'3') │ ᴺᵁᴸᴸ │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
@ -138,10 +138,10 @@ hello world tuple sometimes_nulls
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
Showed first 6.
|
||||
┌─[1mhello[0m─┬─[1mworld[0m─┬─[1mtuple[0m───┬─[1msometimes_nulls[0m─┐
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 0 │ 0 │ (0,'0') │ ᴺᵁᴸᴸ │
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 3 │ 3 │ (3,'3') │ ᴺᵁᴸᴸ │
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┌─[1mhello[0m─┬─[1mworld[0m─┬─[1mtuple[0m───┬─[1msometimes_nulls[0m─┐
|
||||
@ -150,10 +150,10 @@ hello world tuple sometimes_nulls
|
||||
Showed first 6.
|
||||
[1mhello[0m [1mworld[0m [1mtuple[0m [1msometimes_nulls[0m
|
||||
|
||||
0 0 (0,'0') \N
|
||||
0 0 (0,'0') ᴺᵁᴸᴸ
|
||||
1 1 (1,'1') 1
|
||||
2 2 (2,'2') 2
|
||||
3 3 (3,'3') \N
|
||||
3 3 (3,'3') ᴺᵁᴸᴸ
|
||||
4 4 (4,'4') 1
|
||||
[1mhello[0m [1mworld[0m [1mtuple[0m [1msometimes_nulls[0m
|
||||
|
||||
@ -161,10 +161,10 @@ hello world tuple sometimes_nulls
|
||||
|
||||
Showed first 6.
|
||||
┌─[1mhello[0m─┬─[1mworld[0m─┬─[1mtuple[0m───┬─[1msometimes_nulls[0m─┐
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 0 │ 0 │ (0,'0') │ ᴺᵁᴸᴸ │
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 3 │ 3 │ (3,'3') │ ᴺᵁᴸᴸ │
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
│ 5 │ 5 │ (5,'5') │ 2 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
@ -172,13 +172,13 @@ Showed first 6.
|
||||
┏━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
|
||||
┃ hello ┃ world ┃ tuple ┃ sometimes_nulls ┃
|
||||
┡━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 0 │ 0 │ (0,'0') │ ᴺᵁᴸᴸ │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 3 │ 3 │ (3,'3') │ ᴺᵁᴸᴸ │
|
||||
├───────┼───────┼─────────┼─────────────────┤
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
@ -189,10 +189,10 @@ Showed first 6.
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
Showed first 6.
|
||||
┌─hello─┬─world─┬─tuple───┬─sometimes_nulls─┐
|
||||
│ 0 │ 0 │ (0,'0') │ \N │
|
||||
│ 0 │ 0 │ (0,'0') │ ᴺᵁᴸᴸ │
|
||||
│ 1 │ 1 │ (1,'1') │ 1 │
|
||||
│ 2 │ 2 │ (2,'2') │ 2 │
|
||||
│ 3 │ 3 │ (3,'3') │ \N │
|
||||
│ 3 │ 3 │ (3,'3') │ ᴺᵁᴸᴸ │
|
||||
│ 4 │ 4 │ (4,'4') │ 1 │
|
||||
└───────┴───────┴─────────┴─────────────────┘
|
||||
┌─hello─┬─world─┬─tuple───┬─sometimes_nulls─┐
|
||||
@ -201,10 +201,10 @@ Showed first 6.
|
||||
Showed first 6.
|
||||
hello world tuple sometimes_nulls
|
||||
|
||||
0 0 (0,'0') \N
|
||||
0 0 (0,'0') ᴺᵁᴸᴸ
|
||||
1 1 (1,'1') 1
|
||||
2 2 (2,'2') 2
|
||||
3 3 (3,'3') \N
|
||||
3 3 (3,'3') ᴺᵁᴸᴸ
|
||||
4 4 (4,'4') 1
|
||||
hello world tuple sometimes_nulls
|
||||
|
||||
|
@ -10,6 +10,6 @@
|
||||
│ (8,2,NULL) │
|
||||
│ (9,NULL,'1') │
|
||||
└───────────────┘
|
||||
┌─x──┬─y──────┐
|
||||
│ \N │ (NULL) │
|
||||
└────┴────────┘
|
||||
┌─x────┬─y──────┐
|
||||
│ ᴺᵁᴸᴸ │ (NULL) │
|
||||
└──────┴────────┘
|
||||
|
@ -131,157 +131,6 @@ count(): 20
|
||||
Showed first 4.
|
||||
|
||||
|
||||
Totals:
|
||||
───────
|
||||
k: 0
|
||||
count(): 100
|
||||
|
||||
Min:
|
||||
────
|
||||
k: 0
|
||||
count(): 20
|
||||
|
||||
Max:
|
||||
────
|
||||
k: 4
|
||||
count(): 20
|
||||
Row 1:
|
||||
──────
|
||||
k: 0
|
||||
count(): 20
|
||||
|
||||
Row 2:
|
||||
──────
|
||||
k: 1
|
||||
count(): 20
|
||||
|
||||
Row 3:
|
||||
──────
|
||||
k: 2
|
||||
count(): 20
|
||||
|
||||
Row 4:
|
||||
──────
|
||||
k: 3
|
||||
count(): 20
|
||||
|
||||
Showed first 4.
|
||||
|
||||
|
||||
Totals:
|
||||
───────
|
||||
k: 0
|
||||
count(): 100
|
||||
|
||||
Min:
|
||||
────
|
||||
k: 0
|
||||
count(): 20
|
||||
|
||||
Max:
|
||||
────
|
||||
k: 4
|
||||
count(): 20
|
||||
Row 1:
|
||||
──────
|
||||
k: 0
|
||||
count(): 20
|
||||
|
||||
Row 2:
|
||||
──────
|
||||
k: 1
|
||||
count(): 20
|
||||
|
||||
Row 3:
|
||||
──────
|
||||
k: 2
|
||||
count(): 20
|
||||
|
||||
Row 4:
|
||||
──────
|
||||
k: 3
|
||||
count(): 20
|
||||
|
||||
Showed first 4.
|
||||
|
||||
|
||||
Totals:
|
||||
───────
|
||||
k: 0
|
||||
count(): 100
|
||||
|
||||
Min:
|
||||
────
|
||||
k: 0
|
||||
count(): 20
|
||||
|
||||
Max:
|
||||
────
|
||||
k: 4
|
||||
count(): 20
|
||||
Row 1:
|
||||
──────
|
||||
k: 0
|
||||
count(): 20
|
||||
|
||||
Row 2:
|
||||
──────
|
||||
k: 1
|
||||
count(): 20
|
||||
|
||||
Row 3:
|
||||
──────
|
||||
k: 2
|
||||
count(): 20
|
||||
|
||||
Row 4:
|
||||
──────
|
||||
k: 3
|
||||
count(): 20
|
||||
|
||||
Row 5:
|
||||
──────
|
||||
k: 4
|
||||
count(): 20
|
||||
|
||||
|
||||
Totals:
|
||||
───────
|
||||
k: 0
|
||||
count(): 100
|
||||
|
||||
Min:
|
||||
────
|
||||
k: 0
|
||||
count(): 20
|
||||
|
||||
Max:
|
||||
────
|
||||
k: 4
|
||||
count(): 20
|
||||
Row 1:
|
||||
──────
|
||||
k: 0
|
||||
count(): 20
|
||||
|
||||
Row 2:
|
||||
──────
|
||||
k: 1
|
||||
count(): 20
|
||||
|
||||
Row 3:
|
||||
──────
|
||||
k: 2
|
||||
count(): 20
|
||||
|
||||
Row 4:
|
||||
──────
|
||||
k: 3
|
||||
count(): 20
|
||||
|
||||
Showed first 4.
|
||||
|
||||
|
||||
Totals:
|
||||
───────
|
||||
k: 0
|
||||
|
@ -8,15 +8,3 @@ SELECT k, count() FROM (SELECT number % 5 AS k FROM system.numbers LIMIT 100) GR
|
||||
|
||||
SET output_format_pretty_max_rows = 4;
|
||||
SELECT k, count() FROM (SELECT number % 5 AS k FROM system.numbers LIMIT 100) GROUP BY k WITH TOTALS ORDER BY k FORMAT Vertical;
|
||||
|
||||
|
||||
SELECT k, count() FROM (SELECT number % 5 AS k FROM system.numbers LIMIT 100) GROUP BY k WITH TOTALS ORDER BY k FORMAT VerticalRaw;
|
||||
|
||||
SET extremes = 1;
|
||||
SELECT k, count() FROM (SELECT number % 5 AS k FROM system.numbers LIMIT 100) GROUP BY k WITH TOTALS ORDER BY k FORMAT VerticalRaw;
|
||||
|
||||
SET output_format_pretty_max_rows = 5;
|
||||
SELECT k, count() FROM (SELECT number % 5 AS k FROM system.numbers LIMIT 100) GROUP BY k WITH TOTALS ORDER BY k FORMAT VerticalRaw;
|
||||
|
||||
SET output_format_pretty_max_rows = 4;
|
||||
SELECT k, count() FROM (SELECT number % 5 AS k FROM system.numbers LIMIT 100) GROUP BY k WITH TOTALS ORDER BY k FORMAT VerticalRaw;
|
||||
|
@ -57,12 +57,12 @@
|
||||
│ 100000000 │ 100000000 │
|
||||
│ 1000000000 │ 1000000000 │
|
||||
└────────────┴────────────┘
|
||||
┏━━━━━━━━━━━━━━━━━━┓
|
||||
┃ [1m\'\\\\\\\'\\\'\'[0m ┃
|
||||
┡━━━━━━━━━━━━━━━━━━┩
|
||||
│ \\\'\' │
|
||||
└──────────────────┘
|
||||
┏━━━━━━━━━━┓
|
||||
┃ [1m'\\\'\''[0m ┃
|
||||
┡━━━━━━━━━━┩
|
||||
│ \'' │
|
||||
└──────────┘
|
||||
Row 1:
|
||||
──────
|
||||
\'\\\\\\\'\\\'\': \\\'\'
|
||||
1: 1
|
||||
'\\\'\'': \''
|
||||
1: 1
|
||||
|
@ -19,7 +19,7 @@ s a b
|
||||
19700102010203Z 1970-01-02 01:02:03 1970-01-02 01:02:03
|
||||
1970/01/02 010203Z 1970-01-02 01:02:03 1970-01-02 01:02:03
|
||||
20 2000-01-20 00:00:00 2000-01-20 00:00:00
|
||||
201 \N 0000-00-00 00:00:00
|
||||
201 ᴺᵁᴸᴸ 0000-00-00 00:00:00
|
||||
20160101 2016-01-01 00:00:00 2016-01-01 00:00:00
|
||||
2016-01-01 2016-01-01 00:00:00 2016-01-01 00:00:00
|
||||
201601-01 2016-01-01 01:00:00 2016-01-01 01:00:00
|
||||
@ -35,7 +35,7 @@ s a b
|
||||
2017/01/01 2017-01-01 00:00:00 2017-01-01 00:00:00
|
||||
201701 02 010203 UTC+0300 2017-01-01 22:02:03 2017-01-01 22:02:03
|
||||
2017-01-02 03:04:05 2017-01-02 03:04:05 2017-01-02 03:04:05
|
||||
2017-01-0203:04:05 \N 0000-00-00 00:00:00
|
||||
2017-01-0203:04:05 ᴺᵁᴸᴸ 0000-00-00 00:00:00
|
||||
2017-01-02 03:04:05+0 2017-01-02 03:04:05 2017-01-02 03:04:05
|
||||
2017-01-02 03:04:05+00 2017-01-02 03:04:05 2017-01-02 03:04:05
|
||||
2017-01-02 03:04:05+0000 2017-01-02 03:04:05 2017-01-02 03:04:05
|
||||
@ -65,7 +65,7 @@ s a b
|
||||
2017 25 1:2:3 0000-00-00 00:00:00 0000-00-00 00:00:00
|
||||
2017 25 Apr 1:2:3 2017-04-01 01:02:03 2017-04-01 01:02:03
|
||||
2017 Apr 01 11:22:33 2017-04-01 11:22:33 2017-04-01 11:22:33
|
||||
2017 Apr 02 01/02/03 UTC+0300 \N 0000-00-00 00:00:00
|
||||
2017 Apr 02 01/02/03 UTC+0300 ᴺᵁᴸᴸ 0000-00-00 00:00:00
|
||||
2017 Apr 02 010203 UTC+0300 2017-04-01 22:02:03 2017-04-01 22:02:03
|
||||
2017 Apr 02 01:2:3 UTC+0300 2017-04-01 22:02:03 2017-04-01 22:02:03
|
||||
2017 Apr 02 1:02:3 2017-04-02 01:02:03 2017-04-02 01:02:03
|
||||
@ -91,14 +91,14 @@ s a b
|
||||
25 Jan 2017 1:2:3 Z 2017-01-25 01:02:03 2017-01-25 01:02:03
|
||||
25 Jan 2017 1:2:3 Z +0300 2017-01-24 22:02:03 2017-01-24 22:02:03
|
||||
25 Jan 2017 1:2:3 Z+03:00 2017-01-24 22:02:03 2017-01-24 22:02:03
|
||||
25 Jan 2017 1:2:3 Z +0300 OM \N 0000-00-00 00:00:00
|
||||
25 Jan 2017 1:2:3 Z +0300 OM ᴺᵁᴸᴸ 0000-00-00 00:00:00
|
||||
25 Jan 2017 1:2:3 Z +03:00 PM 2017-01-25 10:02:03 2017-01-25 10:02:03
|
||||
25 Jan 2017 1:2:3 Z +0300 PM 2017-01-25 10:02:03 2017-01-25 10:02:03
|
||||
25 Jan 2017 1:2:3 Z+03:00 PM 2017-01-25 10:02:03 2017-01-25 10:02:03
|
||||
25 Jan 2017 1:2:3 Z +03:30 PM 2017-01-25 09:32:03 2017-01-25 09:32:03
|
||||
25 Jan 2017 1:2:3Z Mo \N 0000-00-00 00:00:00
|
||||
25 Jan 2017 1:2:3Z Mo ᴺᵁᴸᴸ 0000-00-00 00:00:00
|
||||
25 Jan 2017 1:2:3Z Mon 2017-01-25 01:02:03 2017-01-25 01:02:03
|
||||
25 Jan 2017 1:2:3Z Moo \N 0000-00-00 00:00:00
|
||||
25 Jan 2017 1:2:3Z Moo ᴺᵁᴸᴸ 0000-00-00 00:00:00
|
||||
25 Jan 2017 1:2:3 Z PM 2017-01-25 13:02:03 2017-01-25 13:02:03
|
||||
25 Jan 2017 1:2:3Z PM 2017-01-25 13:02:03 2017-01-25 13:02:03
|
||||
25 Jan 2017 1:2:3 Z PM +03:00 2017-01-25 10:02:03 2017-01-25 10:02:03
|
||||
|
Loading…
Reference in New Issue
Block a user