15 package com.cloudera.impala.analysis;
22 import com.cloudera.impala.thrift.TAlterTableParams;
23 import com.cloudera.impala.thrift.TAlterTableSetLocationParams;
24 import com.cloudera.impala.thrift.TAlterTableType;
25 import com.google.common.base.Preconditions;
26 import org.apache.hadoop.fs.permission.FsAction;
36 super(tableName, partitionSpec);
37 Preconditions.checkNotNull(location);
38 this.location_ = location;
45 TAlterTableParams params = super.toThrift();
46 params.setAlter_type(TAlterTableType.SET_LOCATION);
47 TAlterTableSetLocationParams locationParams =
52 params.setSet_location_params(locationParams);
58 super.analyze(analyzer);
59 location_.analyze(analyzer,
Privilege.ALL, FsAction.READ_WRITE);
62 Preconditions.checkNotNull(table);
64 HdfsTable hdfsTable = (HdfsTable) table;
69 partitionSpec.getPartitionSpecKeyValues());
70 Preconditions.checkNotNull(partition);
73 "please uncache before changing the location using: ALTER TABLE %s %s " +
74 "SET UNCACHED", table.getFullName(), partitionSpec.toSql()));
78 "uncache before changing the location using: ALTER TABLE %s SET UNCACHED",
79 table.getFullName()));
PartitionSpec getPartitionSpec()
AlterTableSetLocationStmt(TableName tableName, PartitionSpec partitionSpec, HdfsUri location)
TAlterTableParams toThrift()
void analyze(Analyzer analyzer)