mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Add table name into logs for StorageDistributed
This commit is contained in:
parent
36c7a486a1
commit
bc4b75dead
@ -278,6 +278,7 @@ StorageDistributed::StorageDistributed(
|
||||
, remote_database(remote_database_)
|
||||
, remote_table(remote_table_)
|
||||
, global_context(std::make_unique<Context>(context_))
|
||||
, log(&Logger::get("StorageDistributed (" + id_.table_name + ")"))
|
||||
, cluster_name(global_context->getMacros()->expand(cluster_name_))
|
||||
, has_sharding_key(sharding_key_)
|
||||
, storage_policy(storage_policy_)
|
||||
@ -474,18 +475,15 @@ Pipes StorageDistributed::read(
|
||||
if (settings.optimize_skip_unused_shards)
|
||||
{
|
||||
ClusterPtr optimized_cluster = getOptimizedCluster(context, query_info.query);
|
||||
auto table_id = getStorageID();
|
||||
if (optimized_cluster)
|
||||
{
|
||||
LOG_DEBUG(log, "Reading from " << table_id.getNameForLogs() << ": "
|
||||
"Skipping irrelevant shards - the query will be sent to the following shards of the cluster (shard numbers): "
|
||||
" " << makeFormattedListOfShards(optimized_cluster));
|
||||
LOG_DEBUG(log, "Skipping irrelevant shards - the query will be sent to the following shards of the cluster (shard numbers): " <<
|
||||
makeFormattedListOfShards(optimized_cluster));
|
||||
cluster = optimized_cluster;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG(log, "Reading from " << table_id.getNameForLogs() <<
|
||||
(has_sharding_key ? "" : " (no sharding key)") << ": "
|
||||
LOG_DEBUG(log, (has_sharding_key ? "" : " (no sharding key)") << ": "
|
||||
"Unable to figure out irrelevant shards from WHERE/PREWHERE clauses - "
|
||||
"the query will be sent to all shards of the cluster");
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ public:
|
||||
ASTPtr remote_table_function_ptr;
|
||||
|
||||
std::unique_ptr<Context> global_context;
|
||||
Logger * log = &Logger::get("StorageDistributed");
|
||||
Logger * log;
|
||||
|
||||
/// Used to implement TableFunctionRemote.
|
||||
std::shared_ptr<Cluster> owned_cluster;
|
||||
|
Loading…
Reference in New Issue
Block a user