mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 12:32:04 +00:00
Disable optimize_skip_unused_shards_rewrite_in for composite keys
It never worked, since shardContains() accept only one value, and it will throw "Not found column X in block" when sharding key consist from multiple columns. Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
32ed192434
commit
8a1fe33304
@ -245,7 +245,12 @@ void executeQuery(
|
||||
const auto & shard_info = cluster->getShardsInfo()[i];
|
||||
|
||||
auto query_for_shard = query_info.query_tree->clone();
|
||||
if (sharding_key_expr && query_info.optimized_cluster && settings.optimize_skip_unused_shards_rewrite_in && shards > 1)
|
||||
if (sharding_key_expr &&
|
||||
query_info.optimized_cluster &&
|
||||
settings.optimize_skip_unused_shards_rewrite_in &&
|
||||
shards > 1 &&
|
||||
/// TODO: support composite sharding key
|
||||
sharding_key_expr->getRequiredColumns().size() == 1)
|
||||
{
|
||||
OptimizeShardingKeyRewriteInVisitor::Data visitor_data{
|
||||
sharding_key_expr,
|
||||
@ -281,7 +286,12 @@ void executeQuery(
|
||||
const auto & shard_info = cluster->getShardsInfo()[i];
|
||||
|
||||
ASTPtr query_ast_for_shard = query_info.query->clone();
|
||||
if (sharding_key_expr && query_info.optimized_cluster && settings.optimize_skip_unused_shards_rewrite_in && shards > 1)
|
||||
if (sharding_key_expr &&
|
||||
query_info.optimized_cluster &&
|
||||
settings.optimize_skip_unused_shards_rewrite_in &&
|
||||
shards > 1 &&
|
||||
/// TODO: support composite sharding key
|
||||
sharding_key_expr->getRequiredColumns().size() == 1)
|
||||
{
|
||||
OptimizeShardingKeyRewriteInVisitor::Data visitor_data{
|
||||
sharding_key_expr,
|
||||
|
Loading…
Reference in New Issue
Block a user