2019-09-18 12:46:57 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Interpreters/IJoin.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
struct ColumnWithTypeAndName;
|
|
|
|
class Block;
|
|
|
|
class IColumn;
|
|
|
|
using ColumnRawPtrs = std::vector<const IColumn *>;
|
|
|
|
|
|
|
|
namespace JoinCommon
|
|
|
|
{
|
|
|
|
|
2020-06-04 10:07:22 +00:00
|
|
|
void convertColumnToNullable(ColumnWithTypeAndName & column, bool low_card_nullability = false);
|
2019-09-18 12:46:57 +00:00
|
|
|
void convertColumnsToNullable(Block & block, size_t starting_pos = 0);
|
2019-10-29 19:39:42 +00:00
|
|
|
void removeColumnNullability(ColumnWithTypeAndName & column);
|
2019-12-17 15:02:42 +00:00
|
|
|
Columns materializeColumns(const Block & block, const Names & names);
|
|
|
|
ColumnRawPtrs materializeColumnsInplace(Block & block, const Names & names);
|
|
|
|
ColumnRawPtrs getRawPointers(const Columns & columns);
|
2019-09-18 12:46:57 +00:00
|
|
|
void removeLowCardinalityInplace(Block & block);
|
|
|
|
|
|
|
|
/// Split key and other columns by keys name list
|
2020-03-13 08:15:43 +00:00
|
|
|
void splitAdditionalColumns(const Block & sample_block, const Names & key_names, Block & block_keys, Block & block_others);
|
|
|
|
ColumnRawPtrs extractKeysForJoin(const Block & block_keys, const Names & key_names_right);
|
2019-09-18 12:46:57 +00:00
|
|
|
|
|
|
|
/// Throw an exception if blocks have different types of key columns. Compare up to Nullability.
|
|
|
|
void checkTypesOfKeys(const Block & block_left, const Names & key_names_left, const Block & block_right, const Names & key_names_right);
|
|
|
|
|
|
|
|
void createMissedColumns(Block & block);
|
2019-09-19 14:53:03 +00:00
|
|
|
void joinTotals(const Block & totals, const Block & columns_to_add, const Names & key_names_right, Block & block);
|
2019-09-18 12:46:57 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|