ClickHouse/src/Interpreters/InterpreterAlterQuery.h

35 lines
822 B
C++
Raw Normal View History

2013-08-07 13:07:42 +00:00
#pragma once
#include <Interpreters/IInterpreter.h>
2019-03-11 14:01:45 +00:00
#include <Parsers/IAST_fwd.h>
2013-08-07 13:07:42 +00:00
namespace DB
{
2020-01-24 16:20:36 +00:00
class AccessRightsElements;
class ASTAlterCommand;
2020-01-24 16:20:36 +00:00
2018-12-25 23:11:36 +00:00
2017-06-02 21:37:28 +00:00
/** Allows you add or remove a column in the table.
* It also allows you to manipulate the partitions of the MergeTree family tables.
2013-08-07 13:07:42 +00:00
*/
class InterpreterAlterQuery : public IInterpreter, WithContext
2013-08-07 13:07:42 +00:00
{
public:
InterpreterAlterQuery(const ASTPtr & query_ptr_, ContextPtr context_);
2013-08-07 13:07:42 +00:00
BlockIO execute() override;
2013-08-07 13:07:42 +00:00
static AccessRightsElements getRequiredAccessForCommand(const ASTAlterCommand & command, const String & database, const String & table);
void extendQueryLogElemImpl(QueryLogElement & elem, const ASTPtr & ast, ContextPtr context) const override;
2020-12-14 03:30:39 +00:00
private:
2020-01-24 16:20:36 +00:00
AccessRightsElements getRequiredAccess() const;
ASTPtr query_ptr;
2013-08-07 13:07:42 +00:00
};
2013-08-07 13:07:42 +00:00
}