Properly check distinct columns.

This commit is contained in:
Nikolai Kochetov 2020-11-26 12:46:41 +03:00
parent 4c09880bc4
commit 4378ca21ca
3 changed files with 3 additions and 4 deletions

View File

@ -11,7 +11,7 @@ static ITransformingStep::Traits getTraits()
return ITransformingStep::Traits
{
{
.preserves_distinct_columns = true,
.preserves_distinct_columns = false, /// TODO: check if true later.
.returns_single_stream = false,
.preserves_number_of_streams = true,
.preserves_sorting = true,

View File

@ -109,7 +109,6 @@ JoinStep::JoinStep(const DataStream & input_stream_, JoinPtr join_)
getJoinTraits())
, join(std::move(join_))
{
updateDistinctColumns(output_stream->header, output_stream->distinct_columns);
}
void JoinStep::transformPipeline(QueryPipeline & pipeline)

View File

@ -55,9 +55,9 @@ void ITransformingStep::updateDistinctColumns(const Block & res_header, NameSet
if (distinct_columns.empty())
return;
for (const auto & column : res_header)
for (const auto & column : distinct_columns)
{
if (distinct_columns.count(column.name) == 0)
if (!res_header.has(column))
{
distinct_columns.clear();
break;