mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Removing dependency on functions from client: bug fixes [#CLICKHOUSE-2].
This commit is contained in:
parent
976e47e1af
commit
24331a18f5
@ -148,7 +148,9 @@ static BlockOutputStreamPtr getOutputImpl(const String & name, WriteBuffer & buf
|
||||
else if (name == "PrettyCompactMonoBlock")
|
||||
{
|
||||
BlockOutputStreamPtr dst = std::make_shared<PrettyCompactBlockOutputStream>(buf, false, settings.output_format_pretty_max_rows, context);
|
||||
return std::make_shared<SquashingBlockOutputStream>(dst, settings.output_format_pretty_max_rows, 0);
|
||||
auto res = std::make_shared<SquashingBlockOutputStream>(dst, settings.output_format_pretty_max_rows, 0);
|
||||
res->disableFlush();
|
||||
return res;
|
||||
}
|
||||
else if (name == "PrettySpace")
|
||||
return std::make_shared<PrettySpaceBlockOutputStream>(buf, false, settings.output_format_pretty_max_rows, context);
|
||||
|
@ -60,7 +60,7 @@ void PrettyBlockOutputStream::calculateWidths(const Block & block, WidthsPerColu
|
||||
{
|
||||
{
|
||||
WriteBufferFromString out(serialized_value);
|
||||
elem.type->serializeTextEscaped(*elem.column, i, out);
|
||||
elem.type->serializeTextEscaped(*elem.column, j, out);
|
||||
}
|
||||
|
||||
widths[i][j] = UTF8::countCodePoints(reinterpret_cast<const UInt8 *>(serialized_value.data()), serialized_value.size());
|
||||
|
@ -44,7 +44,7 @@ protected:
|
||||
const Context & context;
|
||||
|
||||
using Widths = PODArray<size_t>;
|
||||
using WidthsPerColumn = PODArray<Widths>;
|
||||
using WidthsPerColumn = std::vector<Widths>;
|
||||
|
||||
static void calculateWidths(const Block & block, WidthsPerColumn & widths, Widths & max_widths, Widths & name_widths);
|
||||
void writeValueWithPadding(const ColumnWithTypeAndName & elem, size_t row_num, size_t value_width, size_t pad_to_width);
|
||||
|
@ -33,7 +33,8 @@ void SquashingBlockOutputStream::finalize()
|
||||
|
||||
void SquashingBlockOutputStream::flush()
|
||||
{
|
||||
finalize();
|
||||
if (!disable_flush)
|
||||
finalize();
|
||||
output->flush();
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,9 @@ public:
|
||||
void writePrefix() override;
|
||||
void writeSuffix() override;
|
||||
|
||||
/// Don't write blocks less than specified size even when flush method was called by user.
|
||||
void disableFlush() { disable_flush = true; }
|
||||
|
||||
private:
|
||||
BlockOutputStreamPtr output;
|
||||
|
||||
@ -27,6 +30,8 @@ private:
|
||||
bool all_written = false;
|
||||
|
||||
void finalize();
|
||||
|
||||
bool disable_flush = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user