Do not add resize transform for SystemNumbers.

This commit is contained in:
Nikolai Kochetov 2020-01-20 10:24:28 +03:00
parent cd369bea4e
commit 76171c7afc
3 changed files with 5 additions and 2 deletions

View File

@ -95,7 +95,6 @@
#include <DataTypes/DataTypeAggregateFunction.h>
#include <DataStreams/materializeBlock.h>
#include <Processors/Pipe.h>
#include <Storages/System/StorageSystemNumbers.h>
namespace DB
@ -1951,7 +1950,7 @@ void InterpreterSelectQuery::executeAggregation(QueryPipeline & pipeline, const
if (pipeline.getNumStreams() > 1)
{
/// Add resize transform to uniformly distribute data between aggregating streams.
if (!(storage && typeid_cast<const StorageSystemNumbers *>(storage.get())))
if (!(storage && storage->hasEvenlyDistributedRead()))
pipeline.resize(pipeline.getNumStreams(), true, true);
auto many_data = std::make_shared<ManyAggregatedData>(pipeline.getNumStreams());

View File

@ -113,6 +113,8 @@ public:
/// Returns true if the blocks shouldn't be pushed to associated views on insert.
virtual bool noPushingToViews() const { return false; }
virtual bool hasEvenlyDistributedRead() const { return false; }
/// Optional size information of each physical column.
/// Currently it's only used by the MergeTree family for query optimizations.
using ColumnSizeByName = std::unordered_map<std::string, ColumnSize>;

View File

@ -39,6 +39,8 @@ public:
size_t max_block_size,
unsigned num_streams) override;
bool hasEvenlyDistributedRead() const override { return true; }
private:
const std::string name;
bool multithreaded;