提交 867fded9 编写于 作者: N Nikolai Kochetov

Fix prewhere with max_parallel_replicas.

上级 e1521524
......@@ -668,7 +668,7 @@ InterpreterSelectQuery::analyzeExpressions(
ExpressionActionsChain chain(context);
Names additional_required_columns_after_prewhere;
if (storage && query.sample_size())
if (storage && (query.sample_size() || context.getSettingsRef().parallel_replicas_count > 1))
{
Names columns_for_sampling = storage->getColumnsRequiredForSampling();
additional_required_columns_after_prewhere.insert(additional_required_columns_after_prewhere.end(),
......
drop table if exists test_max_parallel_replicas_lr;
CREATE TABLE test_max_parallel_replicas_lr (timestamp UInt64) ENGINE = MergeTree ORDER BY (intHash32(timestamp)) SAMPLE BY intHash32(timestamp);
INSERT INTO test_max_parallel_replicas_lr select number as timestamp from system.numbers limit 100;
SET max_parallel_replicas = 2;
select count() FROM remote('127.0.0.{2|3}', currentDatabase(), test_max_parallel_replicas_lr) PREWHERE timestamp > 0;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册