mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 21:24:28 +00:00
58e5dad1a1
commite712f469a5
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:59:13 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit2a00282308
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:58:30 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit9e06f407c8
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:55:14 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit9581620f1e
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:54:22 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit2a8564c68c
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:47:34 2017 +0300 Less dependencies [#CLICKHOUSE-2] commitcf60632d78
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:40:09 2017 +0300 Less dependencies [#CLICKHOUSE-2] commitee3d1dc6e0
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:22:49 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit65592ef711
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:18:17 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit37972c2573
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:17:06 2017 +0300 Less dependencies [#CLICKHOUSE-2] commitdd909d1499
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:16:28 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit3cf43266ca
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:15:42 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit6731a3df96
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:13:35 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit1b5727e0d5
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:11:18 2017 +0300 Less dependencies [#CLICKHOUSE-2] commitbbcf726a55
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:09:04 2017 +0300 Less dependencies [#CLICKHOUSE-2] commitc03b477d5e
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:06:30 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit2986e2fb04
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:05:44 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit5d6cdef13d
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:04:53 2017 +0300 Less dependencies [#CLICKHOUSE-2] commitf2b819b25c
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:01:47 2017 +0300 Less dependencies [#CLICKHOUSE-2]
74 lines
2.5 KiB
C++
74 lines
2.5 KiB
C++
#pragma once
|
||
|
||
#include <ext/shared_ptr_helper.hpp>
|
||
|
||
#include <DB/Storages/StorageSet.h>
|
||
#include <DB/Parsers/ASTTablesInSelectQuery.h>
|
||
|
||
|
||
namespace DB
|
||
{
|
||
|
||
class Join;
|
||
using JoinPtr = std::shared_ptr<Join>;
|
||
|
||
|
||
/** Позволяет сохранить состояние для последующего использования в правой части JOIN.
|
||
* При вставке в таблицу, данные будут вставлены в состояние,
|
||
* а также записаны в файл-бэкап, для восстановления после перезапуска.
|
||
* Чтение из таблицы напрямую невозможно - возможно лишь указание в правой части JOIN.
|
||
*
|
||
* При использовании, JOIN должен быть соответствующего типа (ANY|ALL LEFT|INNER ...).
|
||
*/
|
||
class StorageJoin : private ext::shared_ptr_helper<StorageJoin>, public StorageSetOrJoinBase
|
||
{
|
||
friend class ext::shared_ptr_helper<StorageJoin>;
|
||
|
||
public:
|
||
static StoragePtr create(
|
||
const String & path_,
|
||
const String & name_,
|
||
const Names & key_names_,
|
||
ASTTableJoin::Kind kind_, ASTTableJoin::Strictness strictness_,
|
||
NamesAndTypesListPtr columns_,
|
||
const NamesAndTypesList & materialized_columns_,
|
||
const NamesAndTypesList & alias_columns_,
|
||
const ColumnDefaults & column_defaults_)
|
||
{
|
||
return ext::shared_ptr_helper<StorageJoin>::make_shared(
|
||
path_, name_, key_names_, kind_, strictness_,
|
||
columns_, materialized_columns_, alias_columns_, column_defaults_
|
||
);
|
||
}
|
||
|
||
String getName() const override { return "Join"; }
|
||
|
||
/// Получить доступ к внутренностям.
|
||
JoinPtr & getJoin() { return join; }
|
||
|
||
/// Убедиться, что структура данных подходит для осуществления JOIN такого типа.
|
||
void assertCompatible(ASTTableJoin::Kind kind_, ASTTableJoin::Strictness strictness_) const;
|
||
|
||
private:
|
||
const Names & key_names;
|
||
ASTTableJoin::Kind kind; /// LEFT | INNER ...
|
||
ASTTableJoin::Strictness strictness; /// ANY | ALL
|
||
|
||
JoinPtr join;
|
||
|
||
StorageJoin(
|
||
const String & path_,
|
||
const String & name_,
|
||
const Names & key_names_,
|
||
ASTTableJoin::Kind kind_, ASTTableJoin::Strictness strictness_,
|
||
NamesAndTypesListPtr columns_,
|
||
const NamesAndTypesList & materialized_columns_,
|
||
const NamesAndTypesList & alias_columns_,
|
||
const ColumnDefaults & column_defaults_);
|
||
|
||
void insertBlock(const Block & block) override;
|
||
size_t getSize() const override;
|
||
};
|
||
|
||
}
|