dbms: implemented method 'pull' for GLOBAL subqueries [#METR-17758].

This commit is contained in:
Alexey Milovidov 2015-09-05 04:22:09 +03:00
parent 9f38f15294
commit 66b130a2e5
4 changed files with 7 additions and 8 deletions

View File

@ -120,7 +120,7 @@ public:
}
protected:
/// Отправить на удаленные реплики все временные таблицы
/// Отправить на удаленные серверы все временные таблицы.
void sendExternalTables()
{
size_t count = parallel_replicas->size();
@ -151,6 +151,7 @@ protected:
parallel_replicas->sendExternalTablesData(external_tables_data);
}
Block readImpl() override
{
if (!sent_query)

View File

@ -129,7 +129,7 @@ private:
NamesAndTypesListPtr chooseColumns(Cluster & cluster, const String & database, const String & table, const Context & context) const
{
/// Запрос на описание таблицы
String query = "DESC TABLE " + database + "." + table;
String query = "DESC TABLE " + backQuoteIfNeed(database) + "." + backQuoteIfNeed(table);
Settings settings = context.getSettings();
NamesAndTypesList res;

View File

@ -443,13 +443,8 @@ void Context::addExternalTable(const String & table_name, StoragePtr storage)
if (process_list_elem)
{
Poco::ScopedLock<Poco::Mutex> lock(shared->mutex);
std::cerr << "adding temporary table with " << current_query_id << ", " << table_name << " \n";
shared->process_list.addTemporaryTable(*process_list_elem, table_name, storage);
}
else
std::cerr << "no process list element";
}

View File

@ -168,7 +168,10 @@ BlockInputStreams StorageDistributed::read(
if (settings.limits.max_network_bandwidth)
throttler.reset(new Throttler(settings.limits.max_network_bandwidth));
Tables external_tables = context.getExternalTables();
Tables external_tables;
if (settings.global_subqueries_method == GlobalSubqueriesMethod::PUSH)
external_tables = context.getExternalTables();
/// Цикл по шардам.
for (auto & conn_pool : cluster.pools)