diff --git a/src/Storages/StorageDistributed.cpp b/src/Storages/StorageDistributed.cpp index 619b1362bff..f23ed8f3d0e 100644 --- a/src/Storages/StorageDistributed.cpp +++ b/src/Storages/StorageDistributed.cpp @@ -679,10 +679,9 @@ void StorageDistributed::read( } const auto & modified_query_ast = ClusterProxy::rewriteSelectQuery( - local_context, query_info.query, + local_context, query_ast, remote_database, remote_table, remote_table_function_ptr); - /// Return directly (with correct header) if no shard to query. if (query_info.getCluster()->getShardsInfo().empty()) {