mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-05 15:21:43 +00:00
b6e01cd47e
* split ColumnAggregateFunction.h * format * Allow use re2_st without cmake * use std type in find_first_symbols.h * fix ArrayEvaluator.h * include fixes * split ColumnConstAggregateFunction.h * fix StorageMaterializedView.h * split AddingDefaultBlockOutputStream.h * move CSVRowInputStream::updateDiagnosticInfo to .cpp * split ParserEnumElement.h * format * split DB/Parsers/ParserUseQuery.h * clean
49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
#pragma once
|
||
|
||
#include <DB/DataStreams/IBlockOutputStream.h>
|
||
#include <DB/Columns/ColumnConst.h>
|
||
#include <DB/Storages/ColumnDefault.h>
|
||
#include <DB/Interpreters/Context.h>
|
||
#include <DB/Interpreters/evaluateMissingDefaults.h>
|
||
|
||
|
||
namespace DB
|
||
{
|
||
|
||
|
||
/** Добавляет в блок недостающие столбцы со значениями по-умолчанию.
|
||
* Эти столбцы - материалированные (не константы).
|
||
*/
|
||
class AddingDefaultBlockOutputStream : public IBlockOutputStream
|
||
{
|
||
public:
|
||
AddingDefaultBlockOutputStream(
|
||
BlockOutputStreamPtr output_,
|
||
NamesAndTypesListPtr required_columns_,
|
||
const ColumnDefaults & column_defaults_,
|
||
const Context & context_,
|
||
bool only_explicit_column_defaults_)
|
||
: output(output_), required_columns(required_columns_),
|
||
column_defaults(column_defaults_), context(context_),
|
||
only_explicit_column_defaults(only_explicit_column_defaults_)
|
||
{
|
||
}
|
||
|
||
void write(const Block & block) override;
|
||
|
||
void flush() override;
|
||
|
||
void writePrefix() override;
|
||
void writeSuffix() override;
|
||
|
||
private:
|
||
BlockOutputStreamPtr output;
|
||
NamesAndTypesListPtr required_columns;
|
||
const ColumnDefaults column_defaults;
|
||
Context context;
|
||
bool only_explicit_column_defaults;
|
||
};
|
||
|
||
|
||
}
|