Fix Distinct properties

This commit is contained in:
Igor Nikonov 2023-03-07 22:40:11 +00:00
parent 6f2851ef70
commit 79d4d029b8

View File

@ -26,13 +26,14 @@ static bool checkColumnsAlreadyDistinct(const Names & columns, const NameSet & d
static ITransformingStep::Traits getTraits(bool pre_distinct, bool already_distinct_columns)
{
const bool preserves_number_of_streams = pre_distinct || already_distinct_columns;
return ITransformingStep::Traits
{
{
.preserves_distinct_columns = already_distinct_columns, /// Will be calculated separately otherwise
.returns_single_stream = !pre_distinct && !already_distinct_columns,
.preserves_number_of_streams = pre_distinct || already_distinct_columns,
.preserves_sorting = true, /// Sorting is preserved indeed because of implementation.
.preserves_number_of_streams = preserves_number_of_streams,
.preserves_sorting = preserves_number_of_streams,
},
{
.preserves_number_of_rows = false,