2014-10-23 13:53:16 +00:00
|
|
|
#pragma once
|
|
|
|
|
2016-01-13 00:32:59 +00:00
|
|
|
#include <unordered_map>
|
2016-08-15 19:41:44 +00:00
|
|
|
#include <string>
|
2014-10-23 13:53:16 +00:00
|
|
|
|
|
|
|
|
2016-01-13 00:32:59 +00:00
|
|
|
namespace DB
|
2014-10-23 13:53:16 +00:00
|
|
|
{
|
|
|
|
|
2016-01-13 00:32:59 +00:00
|
|
|
class Block;
|
|
|
|
class Context;
|
2017-12-25 21:57:29 +00:00
|
|
|
class NamesAndTypesList;
|
2020-10-02 12:38:50 +00:00
|
|
|
class ColumnsDescription;
|
2014-10-23 13:53:16 +00:00
|
|
|
|
2021-02-04 20:36:50 +00:00
|
|
|
class ActionsDAG;
|
|
|
|
using ActionsDAGPtr = std::shared_ptr<ActionsDAG>;
|
|
|
|
|
2021-02-05 15:11:26 +00:00
|
|
|
/// Create actions which adds missing defaults to block according to required_columns using columns description.
|
|
|
|
ActionsDAGPtr evaluateMissingDefaults(
|
2021-02-04 20:36:50 +00:00
|
|
|
const Block & header,
|
2017-12-25 21:57:29 +00:00
|
|
|
const NamesAndTypesList & required_columns,
|
2020-10-02 12:38:50 +00:00
|
|
|
const ColumnsDescription & columns,
|
2018-12-04 20:03:04 +00:00
|
|
|
const Context & context, bool save_unneeded_columns = true);
|
2018-07-04 17:02:47 +00:00
|
|
|
|
2020-02-13 20:09:48 +00:00
|
|
|
/// Tries to convert columns in block to required_columns
|
2020-01-15 13:00:08 +00:00
|
|
|
void performRequiredConversions(Block & block,
|
|
|
|
const NamesAndTypesList & required_columns,
|
|
|
|
const Context & context);
|
2014-10-23 13:53:16 +00:00
|
|
|
}
|