15 package com.cloudera.impala.analysis;
21 import com.cloudera.impala.thrift.TDropTableOrViewParams;
22 import com.cloudera.impala.thrift.TTableName;
23 import com.google.common.base.Preconditions;
42 this.tableName_ = tableName;
43 this.ifExists_ = ifExists;
44 this.dropTable_ = dropTable;
49 StringBuilder sb =
new StringBuilder(
"DROP " + ((
dropTable_) ?
"TABLE" :
"VIEW"));
52 sb.append(tableName_.getTbl());
57 TDropTableOrViewParams params =
new TDropTableOrViewParams();
58 params.setTable_name(
new TTableName(
getDb(),
getTbl()));
75 Preconditions.checkNotNull(table);
78 "DROP TABLE not allowed on a view: %s.%s",
dbName_,
getTbl()));
82 "DROP VIEW not allowed on a table: %s.%s",
dbName_,
getTbl()));
85 if (
ifExists_ && analyzer.getMissingTbls().isEmpty())
return;
95 Preconditions.checkNotNull(
dbName_);
99 public String
getTbl() {
return tableName_.getTbl(); }
final TableName tableName_
DropTableOrViewStmt(TableName tableName, boolean ifExists, boolean dropTable)
TDropTableOrViewParams toThrift()
void analyze(Analyzer analyzer)