showPartsDesc), conf));
setFetchTask(createFetchTask(showPartsDesc.getSchema()));
}
private void analyzeShowCreateTable(ASTNode ast) throws SemanticException {
ShowCreateTableDesc showCreateTblDesc;
String tableName = getUnescapedName((ASTNode)ast.getChild(0));
showCreateTblDesc = new ShowCreateTableDesc(tableName, ctx.getResFile().toString());
try {
Table tab = db.getTable(tableName, true);
if (tab.getTableType() == org.apache.hadoop.hive.metastore.TableType.INDEX_TABLE) {
throw new SemanticException(ErrorMsg.SHOW_CREATETABLE_INDEX.getMsg(tableName
+ " has table type INDEX_TABLE"));
}
inputs.add(new ReadEntity(tab));
} catch (SemanticException e) {
throw e;
} catch (HiveException e) {
throw new SemanticException(ErrorMsg.INVALID_TABLE.getMsg(tableName));
}
rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(),
showCreateTblDesc), conf));
setFetchTask(createFetchTask(showCreateTblDesc.getSchema()));
}