Apply suggestions from code review

Co-authored-by: Nikita Taranov <nikita.taranov@clickhouse.com>
This commit is contained in:
Vladimir C 2023-02-09 15:03:10 +01:00
parent e4c0afcc3e
commit 1a89ecd386
4 changed files with 2 additions and 8 deletions

View File

@ -1547,6 +1547,8 @@ void InterpreterSelectQuery::executeImpl(QueryPlan & query_plan, std::optional<P
};
/// This optimization relies on the sorting that should buffer the whole stream before emitting any rows.
/// It doesn't hold such a guarantee for streams with const keys.
/// Note: it's also doesn't work with the read-in-order optimization.
/// No checks here because read in order is not applied if we have `CreateSetAndFilterOnTheFlyStep` in the pipeline between the reading and sorting steps.
bool has_non_const_keys = has_non_const(query_plan.getCurrentDataStream().header, join_clause.key_names_left)
&& has_non_const(joined_plan->getCurrentDataStream().header, join_clause.key_names_right);

View File

@ -1,6 +1,5 @@
#include <Processors/PingPongProcessor.h>
#include <Common/logger_useful.h>
namespace DB
{

View File

@ -12,4 +12,3 @@ a a
a a
1
1
a a

View File

@ -41,9 +41,3 @@ SELECT count() == 0 FROM (EXPLAIN PIPELINE
;
-- WITH CUBE is not supported in allow_experimental_analyzer, so the result number of rows is different
SELECT * FROM ( SELECT 'a' AS key ) AS t1
INNER JOIN ( SELECT 'a' AS key GROUP BY ignore(1), ignore(2) WITH CUBE ) AS t2
ON t1.key = t2.key
SETTINGS allow_experimental_analyzer = 1
;