15 package com.cloudera.impala.analysis;
20 import com.cloudera.impala.thrift.TAccessEvent;
21 import com.cloudera.impala.thrift.TAlterTableOrViewRenameParams;
22 import com.cloudera.impala.thrift.TAlterTableParams;
23 import com.cloudera.impala.thrift.TAlterTableType;
24 import com.cloudera.impala.thrift.TTableName;
25 import com.google.common.base.Preconditions;
40 boolean renameTable) {
42 Preconditions.checkState(newTableName != null && !newTableName.isEmpty());
48 return newTableName_.getTbl();
58 TAlterTableParams params = super.toThrift();
60 (
renameTable_) ? TAlterTableType.RENAME_TABLE : TAlterTableType.RENAME_VIEW);
61 TAlterTableOrViewRenameParams renameParams =
63 params.setRename_params(renameParams);
69 newTableName_.analyze();
73 "ALTER TABLE not allowed on a view: %s", table_.getFullName()));
77 "ALTER VIEW not allowed on a table: %s", table_.getFullName()));
AlterTableOrViewRenameStmt(TableName oldTableName, TableName newTableName, boolean renameTable)
TAlterTableParams toThrift()
void analyze(Analyzer analyzer)
static final String TBL_ALREADY_EXISTS_ERROR_MSG
final TableName newTableName_
final TableName tableName_
final boolean renameTable_