**Describe what's wrong**
Request with `DISTINCT`+`LIMIT BY`+`LIMIT` return less rows than provided in `LIMIT`

**Does it reproduce on recent release?**
22.11

**How to reproduce**
The following query from hits table returns less number of rows then provided in LIMIT
```
SELECT DISTINCT
    Title,
    SearchPhrase
FROM hits_v1
WHERE (SearchPhrase != '') AND (NOT match(Title, '[а-яА-ЯёЁ]')) AND (NOT match(SearchPhrase, '[а-яА-ЯёЁ]'))
LIMIT 1 BY
    Title,
    SearchPhrase
LIMIT 10
````
**Expected behavior**
Query returns number of rows provided in `LIMIT`

{
                        auto creating_set_step = std::make_unique<CreateSetAndFilterOnTheFlyStep>(
                            plan.getCurrentDataStream(), key_names, settings.max_rows_in_set_to_optimize_join, crosswise_connection, join_pos);
                        creating_set_step->setStepDescription(fmt::format("Create set and filter {} joined stream", join_pos));
                        auto * step_raw_ptr = creating_set_step.get();
                        plan.addStep(std::move(creating_set_step));
                        return step_raw_ptr;
                    };
                    if (expressions.join->pipelineType() == JoinPipelineType::YShaped)
                    {
                        const auto & table_join = expressions.join->getTableJoin();
                        const auto & join_clause = table_join.getOnlyClause();
                        auto join_kind = table_join.kind();
                        bool kind_allows_filtering = isInner(join_kind) || isLeft(join_kind) || isRight(join_kind);
                        if (settings.max_rows_in_set_to_optimize_join > 0 && kind_allows_filtering)
                        {
                            auto * left_set = add_create_set(query_plan, join_clause.key_names_left, JoinTableSide::Left);
                            auto * right_set = add_create_set(*joined_plan, join_clause.key_names_right, JoinTableSide::Right);
                            if (isInnerOrLeft(join_kind))
                                right_set->setFiltering(left_set->getSet());
                            if (isInnerOrRight(join_kind))
                                left_set->setFiltering(right_set->getSet());
                        }
                        add_sorting(query_plan, join_clause.key_names_left, JoinTableSide::Left);
                        add_sorting(*joined_plan, join_clause.key_names_right, JoinTableSide::Right);
                    }
                    QueryPlanStepPtr join_step = std::make_unique<JoinStep>(
                        query_plan.getCurrentDataStream(),
                        joined_plan->getCurrentDataStream(),
                        expressions.join,