1#pragma once
2
3#include <Interpreters/IJoin.h>
4
5namespace DB
6{
7
8struct ColumnWithTypeAndName;
9class Block;
10class IColumn;
11using ColumnRawPtrs = std::vector<const IColumn *>;
12
13namespace JoinCommon
14{
15
16void convertColumnToNullable(ColumnWithTypeAndName & column);
17void convertColumnsToNullable(Block & block, size_t starting_pos = 0);
18void removeColumnNullability(ColumnWithTypeAndName & column);
19Columns materializeColumns(const Block & block, const Names & names);
20ColumnRawPtrs materializeColumnsInplace(Block & block, const Names & names);
21ColumnRawPtrs getRawPointers(const Columns & columns);
22void removeLowCardinalityInplace(Block & block);
23
24/// Split key and other columns by keys name list
25ColumnRawPtrs extractKeysForJoin(const Names & key_names_right, const Block & right_sample_block,
26 Block & sample_block_with_keys, Block & sample_block_with_columns_to_add);
27
28/// Throw an exception if blocks have different types of key columns. Compare up to Nullability.
29void checkTypesOfKeys(const Block & block_left, const Names & key_names_left, const Block & block_right, const Names & key_names_right);
30
31void createMissedColumns(Block & block);
32void joinTotals(const Block & totals, const Block & columns_to_add, const Names & key_names_right, Block & block);
33
34}
35
36}
37