2018-11-27 00:43:58 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-04-10 23:33:54 +00:00
|
|
|
#include <Interpreters/Context_fwd.h>
|
|
|
|
|
2021-02-08 12:52:30 +00:00
|
|
|
#include <memory>
|
2021-04-10 23:33:54 +00:00
|
|
|
#include <string>
|
|
|
|
#include <unordered_map>
|
2018-11-27 00:43:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class Block;
|
|
|
|
class NamesAndTypesList;
|
2020-10-02 12:38:50 +00:00
|
|
|
class ColumnsDescription;
|
2018-11-27 00:43:58 +00:00
|
|
|
|
2021-02-05 11:41:44 +00:00
|
|
|
class ActionsDAG;
|
|
|
|
using ActionsDAGPtr = std::shared_ptr<ActionsDAG>;
|
|
|
|
|
2018-11-27 00:43:58 +00:00
|
|
|
/** Adds three types of columns into block
|
|
|
|
* 1. Columns, that are missed inside request, but present in table without defaults (missed columns)
|
|
|
|
* 2. Columns, that are missed inside request, but present in table with defaults (columns with default values)
|
|
|
|
* 3. Columns that materialized from other columns (materialized columns)
|
2021-04-23 19:08:13 +00:00
|
|
|
* Also can substitute NULL with DEFAULT value in case of INSERT SELECT query (null_as_default) if according setting is 1.
|
2018-11-27 00:43:58 +00:00
|
|
|
* All three types of columns are materialized (not constants).
|
|
|
|
*/
|
2021-02-05 11:41:44 +00:00
|
|
|
ActionsDAGPtr addMissingDefaults(
|
2021-04-23 09:50:56 +00:00
|
|
|
const Block & header, const NamesAndTypesList & required_columns,
|
|
|
|
const ColumnsDescription & columns, ContextPtr context, bool null_as_default = false);
|
2018-11-27 00:43:58 +00:00
|
|
|
}
|