2018-07-04 17:02:47 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-07-20 18:18:43 +00:00
|
|
|
#include <Processors/ISimpleTransform.h>
|
2020-10-02 12:38:50 +00:00
|
|
|
#include <Storages/ColumnsDescription.h>
|
2018-07-04 17:02:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2021-07-20 18:18:43 +00:00
|
|
|
class IInputFormat;
|
|
|
|
|
2018-07-04 17:02:47 +00:00
|
|
|
/// Adds defaults to columns using BlockDelayedDefaults bitmask attached to Block by child InputStream.
|
2021-07-20 18:18:43 +00:00
|
|
|
class AddingDefaultsTransform : public ISimpleTransform
|
2018-07-04 17:02:47 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-07-20 18:18:43 +00:00
|
|
|
AddingDefaultsTransform(
|
|
|
|
const Block & header,
|
2020-10-02 12:38:50 +00:00
|
|
|
const ColumnsDescription & columns_,
|
2021-07-20 18:18:43 +00:00
|
|
|
IInputFormat & input_format_,
|
2021-04-10 23:33:54 +00:00
|
|
|
ContextPtr context_);
|
2018-07-04 17:02:47 +00:00
|
|
|
|
2021-07-20 18:18:43 +00:00
|
|
|
String getName() const override { return "AddingDefaultsTransform"; }
|
2018-07-04 17:02:47 +00:00
|
|
|
|
|
|
|
protected:
|
2021-07-20 18:18:43 +00:00
|
|
|
void transform(Chunk & chunk) override;
|
2018-07-04 17:02:47 +00:00
|
|
|
|
|
|
|
private:
|
2020-10-02 12:38:50 +00:00
|
|
|
const ColumnsDescription columns;
|
2018-07-04 17:02:47 +00:00
|
|
|
const ColumnDefaults column_defaults;
|
2021-07-20 18:18:43 +00:00
|
|
|
IInputFormat & input_format;
|
2021-04-10 23:33:54 +00:00
|
|
|
ContextPtr context;
|
2018-07-04 17:02:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|