2016-05-13 03:22:16 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-03-12 13:47:01 +00:00
|
|
|
#include <Storages/ColumnsDescription.h>
|
2018-07-24 13:10:34 +00:00
|
|
|
#include <Parsers/IAST.h>
|
2018-07-25 12:53:38 +00:00
|
|
|
#include <Parsers/queryToString.h>
|
2019-10-11 14:44:55 +00:00
|
|
|
#include <Interpreters/Cluster.h>
|
2016-05-13 03:22:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2021-07-12 14:54:02 +00:00
|
|
|
|
2016-05-13 03:22:16 +00:00
|
|
|
class Context;
|
2020-03-06 20:38:19 +00:00
|
|
|
struct StorageID;
|
2016-05-13 03:22:16 +00:00
|
|
|
|
2017-04-16 15:00:33 +00:00
|
|
|
/// Find the names and types of the table columns on any server in the cluster.
|
|
|
|
/// Used to implement the `remote` table function and others.
|
2018-03-12 13:47:01 +00:00
|
|
|
ColumnsDescription getStructureOfRemoteTable(
|
2016-05-13 03:22:16 +00:00
|
|
|
const Cluster & cluster,
|
2020-03-06 20:38:19 +00:00
|
|
|
const StorageID & table_id,
|
2021-04-10 23:33:54 +00:00
|
|
|
ContextPtr context,
|
2018-07-24 13:10:34 +00:00
|
|
|
const ASTPtr & table_func_ptr = nullptr);
|
2016-05-13 03:22:16 +00:00
|
|
|
|
2021-07-23 16:30:18 +00:00
|
|
|
|
|
|
|
using ColumnsDescriptionByShardNum = std::unordered_map<UInt32, ColumnsDescription>;
|
|
|
|
|
2022-03-01 16:32:55 +00:00
|
|
|
/// Returns descriptions of columns of type Object for each shard.
|
2021-07-23 16:30:18 +00:00
|
|
|
ColumnsDescriptionByShardNum getExtendedObjectsOfRemoteTables(
|
2021-07-12 14:54:02 +00:00
|
|
|
const Cluster & cluster,
|
|
|
|
const StorageID & remote_table_id,
|
2022-02-09 20:47:53 +00:00
|
|
|
const ColumnsDescription & storage_columns,
|
2021-07-12 14:54:02 +00:00
|
|
|
ContextPtr context);
|
|
|
|
|
2016-05-13 03:22:16 +00:00
|
|
|
}
|