final String oldFQTableName = CatalogUtil.buildFQName(databaseName, originalTableName);
ResultSet res = executeString(createTableStmt);
res.close();
assertTableExists(oldFQTableName);
TableDesc oldTableDesc = client.getTableDesc(oldFQTableName);
// checking the existence of the table directory and validating the path
FileSystem fs = testingCluster.getMaster().getStorageManager().getFileSystem();
Path warehouseDir = TajoConf.getWarehouseDir(testingCluster.getConfiguration());
assertTrue(fs.exists(oldTableDesc.getPath()));
assertEquals(StorageUtil.concatPath(warehouseDir, databaseName, originalTableName), oldTableDesc.getPath());
// Rename
client.executeQuery("ALTER TABLE " + CatalogUtil.denormalizeIdentifier(oldFQTableName)
+ " RENAME to " + CatalogUtil.denormalizeIdentifier(newTableName));
// checking the existence of the new table directory and validating the path
final String newFQTableName = CatalogUtil.buildFQName(databaseName, newTableName);
TableDesc newTableDesc = client.getTableDesc(newFQTableName);
assertTrue(fs.exists(newTableDesc.getPath()));
assertEquals(StorageUtil.concatPath(warehouseDir, databaseName, newTableName), newTableDesc.getPath());
}