diff --git a/dbms/src/DataStreams/tests/aggregating_stream.cpp b/dbms/src/DataStreams/tests/aggregating_stream.cpp index 4e29b32eb69..4fa85c09018 100644 --- a/dbms/src/DataStreams/tests/aggregating_stream.cpp +++ b/dbms/src/DataStreams/tests/aggregating_stream.cpp @@ -17,36 +17,12 @@ #include #include #include +#include #include #include -class OneBlockInputStream : public DB::IBlockInputStream -{ -private: - const DB::Block & block; - bool has_been_read; -public: - OneBlockInputStream(const DB::Block & block_) : block(block_), has_been_read(false) {} - - DB::Block read() - { - if (!has_been_read) - { - has_been_read = true; - return block; - } - else - return DB::Block(); - } - - DB::String getName() const { return "OneBlockInputStream"; } - - DB::BlockInputStreamPtr clone() { return new OneBlockInputStream(block); } -}; - - int main(int argc, char ** argv) { try @@ -116,7 +92,7 @@ int main(int argc, char ** argv) sample.insert(col); } - DB::BlockInputStreamPtr stream = new OneBlockInputStream(block); + DB::BlockInputStreamPtr stream = new DB::OneBlockInputStream(block); stream = new DB::AggregatingBlockInputStream(stream, key_column_numbers, aggregate_descriptions, 0, DB::Limits::THROW); stream = new DB::FinalizingAggregatedBlockInputStream(stream); diff --git a/dbms/src/Interpreters/tests/aggregate.cpp b/dbms/src/Interpreters/tests/aggregate.cpp index 564c5ec4f23..11d2dbb59b2 100644 --- a/dbms/src/Interpreters/tests/aggregate.cpp +++ b/dbms/src/Interpreters/tests/aggregate.cpp @@ -9,38 +9,13 @@ #include #include -#include +#include #include #include -class OneBlockInputStream : public DB::IBlockInputStream -{ -private: - const DB::Block & block; - bool has_been_read; -public: - OneBlockInputStream(const DB::Block & block_) : block(block_), has_been_read(false) {} - - DB::Block read() - { - if (!has_been_read) - { - has_been_read = true; - return block; - } - else - return DB::Block(); - } - - DB::String getName() const { return "OneBlockInputStream"; } - - DB::BlockInputStreamPtr clone() { return new OneBlockInputStream(block); } -}; - - int main(int argc, char ** argv) { try @@ -84,7 +59,7 @@ int main(int argc, char ** argv) block.insert(column_s2); - DB::BlockInputStreamPtr stream = new OneBlockInputStream(block); + DB::BlockInputStreamPtr stream = new DB::OneBlockInputStream(block); DB::AggregatedDataVariants aggregated_data_variants; DB::ColumnNumbers key_column_numbers; diff --git a/dbms/src/Interpreters/tests/expression.cpp b/dbms/src/Interpreters/tests/expression.cpp index ee313902369..12ec30f15e6 100644 --- a/dbms/src/Interpreters/tests/expression.cpp +++ b/dbms/src/Interpreters/tests/expression.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -46,31 +47,6 @@ void dump(DB::IAST & ast, int level = 0) } -class OneBlockInputStream : public DB::IBlockInputStream -{ -private: - const DB::Block & block; - bool has_been_read; -public: - OneBlockInputStream(const DB::Block & block_) : block(block_), has_been_read(false) {} - - DB::Block read() - { - if (!has_been_read) - { - has_been_read = true; - return block; - } - else - return DB::Block(); - } - - DB::String getName() const { return "OneBlockInputStream"; } - - DB::BlockInputStreamPtr clone() { return new OneBlockInputStream(block); } -}; - - int main(int argc, char ** argv) { try @@ -168,7 +144,7 @@ int main(int argc, char ** argv) << std::endl; } - OneBlockInputStream * is = new OneBlockInputStream(block); + DB::OneBlockInputStream * is = new DB::OneBlockInputStream(block); DB::LimitBlockInputStream lis(is, 20, std::max(0, static_cast(n) - 20)); DB::WriteBufferFromOStream out_buf(std::cout); DB::TabSeparatedRowOutputStream os(out_buf, block);