From 626468d255a755d9cc30e85bab3b1816e359fdf6 Mon Sep 17 00:00:00 2001 From: Vitaliy Zakaznikov Date: Sun, 26 Apr 2020 15:56:45 +0200 Subject: [PATCH] Adding support for streaming mode to JSONEachRowRowOutputFormat --- src/Processors/Formats/Impl/JSONEachRowRowOutputFormat.cpp | 6 ++++++ src/Processors/Formats/Impl/JSONEachRowRowOutputFormat.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/Processors/Formats/Impl/JSONEachRowRowOutputFormat.cpp b/src/Processors/Formats/Impl/JSONEachRowRowOutputFormat.cpp index f862a07173..4ca151a6e0 100644 --- a/src/Processors/Formats/Impl/JSONEachRowRowOutputFormat.cpp +++ b/src/Processors/Formats/Impl/JSONEachRowRowOutputFormat.cpp @@ -22,6 +22,12 @@ JSONEachRowRowOutputFormat::JSONEachRowRowOutputFormat(WriteBuffer & out_, const } } +void JSONEachRowRowOutputFormat::consume(DB::Chunk chunk) +{ + IRowOutputFormat::consume(std::move(chunk)); + if (settings.enable_streaming) + flush(); +} void JSONEachRowRowOutputFormat::writeField(const IColumn & column, const IDataType & type, size_t row_num) { diff --git a/src/Processors/Formats/Impl/JSONEachRowRowOutputFormat.h b/src/Processors/Formats/Impl/JSONEachRowRowOutputFormat.h index d2b6937cd0..9ed8670129 100644 --- a/src/Processors/Formats/Impl/JSONEachRowRowOutputFormat.h +++ b/src/Processors/Formats/Impl/JSONEachRowRowOutputFormat.h @@ -25,6 +25,7 @@ public: void writeRowEndDelimiter() override; protected: + void consume(Chunk chunk) override; /// No totals and extremes. void consumeTotals(Chunk) override {} void consumeExtremes(Chunk) override {} -- GitLab