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