**Describe the bug**
ClickHouse version: 20.8.2.3
`SELECT DISTINCT b FROM (SELECT a, b FROM d GROUP BY a, b)` may return duplicate result, here is the step to reproduce:

```sql
CREATE TABLE test_local ON CLUSTER xxx (a String, b Int) Engine=TinyLog;
CREATE TABLE test ON CLUSTER xxx (a String, b Int) Engine = Distributed('xxx', 'default', 'test_local', b);
INSERT INTO test VALUES('a', 0), ('a', 1), ('b', 0)
SELECT DISTINCT b FROM (SELECT b FROM test GROUP BY a, b)
```
Expected result:
0
1
Actual result:
0
0
1

**Possible reason:**

`DistinctStep::checkColumnsAlreadyDistinct` return true while `b` exists in its front inputstream's `distinct_columns`(which is `a` and `b` in previous SQL), so `DistinctStep` is skipped in the final execution pipeline. As the comment of  `DataStream::distinct_columns` says: "Tuples with those columns are distinct. It doesn't mean that columns are distinct separately.", `DistinctStep::checkColumnsAlreadyDistinct` may return wrong result.


#include <Processors/QueryPlan/ITransformingStep.h>
#include <Processors/QueryPipeline.h>
namespace DB
{
ITransformingStep::ITransformingStep(DataStream input_stream, Block output_header, Traits traits, bool collect_processors_)
    : transform_traits(std::move(traits.transform_traits))
    , collect_processors(collect_processors_)
    , data_stream_traits(std::move(traits.data_stream_traits))
{
    input_streams.emplace_back(std::move(input_stream));
    output_stream = createOutputStream(input_streams.front(), std::move(output_header), data_stream_traits);
}
DataStream ITransformingStep::createOutputStream(
    const DataStream & input_stream,
    Block output_header,
    const DataStreamTraits & stream_traits)
{
    DataStream output_stream{.header = std::move(output_header)};
    if (stream_traits.preserves_distinct_columns)
        output_stream.distinct_columns = input_stream.distinct_columns;
    output_stream.has_single_port = stream_traits.returns_single_stream
                                     || (input_stream.has_single_port && stream_traits.preserves_number_of_streams);
    if (stream_traits.preserves_sorting)
    {
        output_stream.sort_description = input_stream.sort_description;
        output_stream.sort_mode = input_stream.sort_mode;
    }
    return output_stream;
}
QueryPipelinePtr ITransformingStep::updatePipeline(QueryPipelines pipelines)