mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
Avoid processing optimize_skip_unused_shards twice
This commit is contained in:
parent
b5995a320a
commit
3474ea044e
@ -530,7 +530,7 @@ void StorageDistributed::read(
|
||||
query_info.query, remote_database, remote_table, remote_table_function_ptr);
|
||||
|
||||
Block header =
|
||||
InterpreterSelectQuery(query_info.query, context, SelectQueryOptions(processed_stage)).getSampleBlock();
|
||||
InterpreterSelectQuery(query_info.query, context, SelectQueryOptions(processed_stage).analyze()).getSampleBlock();
|
||||
|
||||
const Scalars & scalars = context.hasQueryContext() ? context.getQueryContext().getScalars() : Scalars{};
|
||||
|
||||
|
@ -0,0 +1,2 @@
|
||||
StorageDistributed (dist_01758): Auto-increment is 0
|
||||
StorageDistributed (dist_01758): Skipping irrelevant shards - the query will be sent to the following shards of the cluster (shard numbers): [1]
|
12
tests/queries/0_stateless/01758_optimize_skip_unused_shards_once.sh
Executable file
12
tests/queries/0_stateless/01758_optimize_skip_unused_shards_once.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=trace
|
||||
|
||||
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
$CLICKHOUSE_CLIENT --optimize_skip_unused_shards=1 -nm -q "
|
||||
create table dist_01758 as system.one engine=Distributed(test_cluster_two_shards, system, one, dummy);
|
||||
select * from dist_01758 where dummy = 0 format Null;
|
||||
" |& grep -o "StorageDistributed (dist_01758).*"
|
Loading…
Reference in New Issue
Block a user