2016-01-28 01:00:27 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Core/QueryProcessingStage.h>
|
2019-05-17 14:34:25 +00:00
|
|
|
#include <Interpreters/ClusterProxy/IStreamFactory.h>
|
2020-05-20 20:16:32 +00:00
|
|
|
#include <Interpreters/StorageID.h>
|
2019-05-17 14:34:25 +00:00
|
|
|
#include <Storages/IStorage_fwd.h>
|
2016-01-28 01:00:27 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
namespace ClusterProxy
|
|
|
|
{
|
|
|
|
|
2017-07-28 12:58:24 +00:00
|
|
|
class SelectStreamFactory final : public IStreamFactory
|
2016-01-28 01:00:27 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-07-25 12:31:47 +00:00
|
|
|
/// Database in a query.
|
2017-07-28 12:58:24 +00:00
|
|
|
SelectStreamFactory(
|
2018-07-24 13:10:34 +00:00
|
|
|
const Block & header_,
|
|
|
|
QueryProcessingStage::Enum processed_stage_,
|
2020-03-04 20:29:52 +00:00
|
|
|
StorageID main_table_,
|
2019-10-19 20:36:35 +00:00
|
|
|
const Scalars & scalars_,
|
2019-09-18 21:17:00 +00:00
|
|
|
bool has_virtual_shard_num_column_,
|
2018-01-22 04:04:57 +00:00
|
|
|
const Tables & external_tables);
|
2018-07-27 21:33:30 +00:00
|
|
|
|
2018-07-25 12:31:47 +00:00
|
|
|
/// TableFunction in a query.
|
2018-07-24 13:10:34 +00:00
|
|
|
SelectStreamFactory(
|
|
|
|
const Block & header_,
|
|
|
|
QueryProcessingStage::Enum processed_stage_,
|
|
|
|
ASTPtr table_func_ptr_,
|
2019-10-19 20:36:35 +00:00
|
|
|
const Scalars & scalars_,
|
2019-09-18 21:17:00 +00:00
|
|
|
bool has_virtual_shard_num_column_,
|
2018-07-24 13:10:34 +00:00
|
|
|
const Tables & external_tables_);
|
2018-01-22 04:04:57 +00:00
|
|
|
|
|
|
|
void createForShard(
|
|
|
|
const Cluster::ShardInfo & shard_info,
|
|
|
|
const String & query, const ASTPtr & query_ast,
|
2021-04-10 23:33:54 +00:00
|
|
|
ContextPtr context, const ThrottlerPtr & throttler,
|
2020-02-17 10:42:14 +00:00
|
|
|
const SelectQueryInfo & query_info,
|
2020-09-25 13:19:26 +00:00
|
|
|
std::vector<QueryPlanPtr> & plans,
|
2020-09-18 14:16:53 +00:00
|
|
|
Pipes & remote_pipes,
|
2020-11-21 10:35:03 +00:00
|
|
|
Pipes & delayed_pipes,
|
|
|
|
Poco::Logger * log) override;
|
2016-01-28 01:00:27 +00:00
|
|
|
|
|
|
|
private:
|
2018-02-15 18:54:12 +00:00
|
|
|
const Block header;
|
2017-04-17 16:16:04 +00:00
|
|
|
QueryProcessingStage::Enum processed_stage;
|
2020-03-04 20:29:52 +00:00
|
|
|
StorageID main_table = StorageID::createEmpty();
|
2018-07-24 13:10:34 +00:00
|
|
|
ASTPtr table_func_ptr;
|
2019-10-19 20:36:35 +00:00
|
|
|
Scalars scalars;
|
2019-09-18 21:17:00 +00:00
|
|
|
bool has_virtual_shard_num_column = false;
|
2018-02-21 04:14:03 +00:00
|
|
|
Tables external_tables;
|
2016-01-28 01:00:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|