Header in every stream: development [#CLICKHOUSE-2]

This commit is contained in:
Alexey Milovidov 2018-02-16 23:53:47 +03:00
parent a849bb8c04
commit a673790748
5 changed files with 15 additions and 13 deletions

View File

@ -68,9 +68,8 @@ Block AggregatingBlockInputStream::readImpl()
}
}
Block res;
if (isCancelled() || !impl)
return res;
return {};
return impl->read();
}

View File

@ -160,6 +160,8 @@ static Block adaptBlockStructure(const Block & block, const Block & header, cons
return block;
Block res;
res.info = block.info;
for (const auto & elem : header)
res.insert({ castColumn(block.getByName(elem.name), elem.type, context), elem.type, elem.name });
return res;

View File

@ -1026,7 +1026,7 @@ void Aggregator::execute(const BlockInputStreamPtr & stream, AggregatedDataVaria
}
double elapsed_seconds = watch.elapsedSeconds();
size_t rows = result.size();
size_t rows = result.sizeWithoutOverflowRow();
LOG_TRACE(log, std::fixed << std::setprecision(3)
<< "Aggregated. " << src_rows << " to " << rows << " rows (from " << src_bytes / 1048576.0 << " MiB)"
<< " in " << elapsed_seconds << " sec."

View File

@ -812,8 +812,8 @@ struct AggregatedDataVariants : private boost::noncopyable
{
switch (type_)
{
case Type::EMPTY: break;
case Type::without_key: break;
case Type::EMPTY: break;
case Type::without_key: break;
#define M(NAME, IS_TWO_LEVEL) \
case Type::NAME: NAME = std::make_unique<decltype(NAME)::element_type>(); break;
@ -832,8 +832,8 @@ struct AggregatedDataVariants : private boost::noncopyable
{
switch (type)
{
case Type::EMPTY: return 0;
case Type::without_key: return 1;
case Type::EMPTY: return 0;
case Type::without_key: return 1;
#define M(NAME, IS_TWO_LEVEL) \
case Type::NAME: return NAME->data.size() + (without_key != nullptr);
@ -850,8 +850,8 @@ struct AggregatedDataVariants : private boost::noncopyable
{
switch (type)
{
case Type::EMPTY: return 0;
case Type::without_key: return 1;
case Type::EMPTY: return 0;
case Type::without_key: return 1;
#define M(NAME, IS_TWO_LEVEL) \
case Type::NAME: return NAME->data.size();
@ -867,8 +867,8 @@ struct AggregatedDataVariants : private boost::noncopyable
{
switch (type)
{
case Type::EMPTY: return "EMPTY";
case Type::without_key: return "without_key";
case Type::EMPTY: return "EMPTY";
case Type::without_key: return "without_key";
#define M(NAME, IS_TWO_LEVEL) \
case Type::NAME: return #NAME;
@ -884,8 +884,8 @@ struct AggregatedDataVariants : private boost::noncopyable
{
switch (type)
{
case Type::EMPTY: return false;
case Type::without_key: return false;
case Type::EMPTY: return false;
case Type::without_key: return false;
#define M(NAME, IS_TWO_LEVEL) \
case Type::NAME: return IS_TWO_LEVEL;

View File

@ -32,6 +32,7 @@
#include <Common/NetException.h>
namespace DB
{