#pragma once #include #include #include #include #include #include #include namespace DB { class TTLCalcTransform : public IAccumulatingTransform { public: TTLCalcTransform( const Block & header_, const MergeTreeData & storage_, const StorageMetadataPtr & metadata_snapshot_, const MergeTreeData::MutableDataPartPtr & data_part_, time_t current_time, bool force_ ); String getName() const override { return "TTL_CALC"; } Status prepare() override; protected: void consume(Chunk chunk) override; Chunk generate() override; /// Finalizes ttl infos and updates data part void finalize(); private: std::vector algorithms; /// ttl_infos and empty_columns are updating while reading const MergeTreeData::MutableDataPartPtr & data_part; Poco::Logger * log; }; }