2013-06-17 12:40:44 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
|
2013-06-18 09:56:11 +00:00
|
|
|
|
#include <DB/DataStreams/PrettyCompactBlockOutputStream.h>
|
2013-06-17 12:40:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/** Тоже самое, что и PrettyCompactBlockOutputStream, но выводит все max_rows (или меньше,
|
|
|
|
|
* если результат содержит меньшее число строк) одним блоком с одной шапкой.
|
|
|
|
|
*/
|
2013-06-18 09:56:11 +00:00
|
|
|
|
class PrettyCompactMonoBlockOutputStream : public PrettyCompactBlockOutputStream
|
2013-06-17 12:40:44 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2016-12-30 00:15:50 +00:00
|
|
|
|
PrettyCompactMonoBlockOutputStream(WriteBuffer & ostr_, bool no_escapes_, size_t max_rows_, const Context & context_)
|
|
|
|
|
: PrettyCompactBlockOutputStream(ostr_, no_escapes_, max_rows_, context_) {}
|
2013-06-17 12:40:44 +00:00
|
|
|
|
|
2014-11-08 23:52:18 +00:00
|
|
|
|
void write(const Block & block) override;
|
|
|
|
|
void writeSuffix() override;
|
|
|
|
|
|
2013-06-17 12:40:44 +00:00
|
|
|
|
private:
|
2016-05-28 10:35:44 +00:00
|
|
|
|
using Blocks_t = std::vector<Block>;
|
2014-11-08 23:52:18 +00:00
|
|
|
|
|
2013-06-17 12:40:44 +00:00
|
|
|
|
Blocks_t blocks;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|