#pragma once #include #include #include #include namespace DB { class Context; class WriteBuffer; class ReadBuffer; struct MutationCommand { ASTPtr ast; /// The AST of the whole command enum Type { EMPTY, /// Not used. DELETE, UPDATE, MATERIALIZE_INDEX }; Type type = EMPTY; ASTPtr predicate; std::unordered_map column_to_update_expression; /// For MATERIALIZE INDEX String index_name; ASTPtr partition; static std::optional parse(ASTAlterCommand * command); }; class MutationCommands : public std::vector { public: std::shared_ptr ast() const; void writeText(WriteBuffer & out) const; void readText(ReadBuffer & in); }; }