showColumnsDesc), conf));
setFetchTask(createFetchTask(showColumnsDesc.getSchema()));
}
private void analyzeShowTableStatus(ASTNode ast) throws SemanticException {
ShowTableStatusDesc showTblStatusDesc;
String tableNames = getUnescapedName((ASTNode) ast.getChild(0));
String dbName = SessionState.get().getCurrentDatabase();
int children = ast.getChildCount();
HashMap<String, String> partSpec = null;
if (children >= 2) {
if (children > 3) {
throw new SemanticException(ErrorMsg.GENERIC_ERROR.getMsg());
}
for (int i = 1; i < children; i++) {
ASTNode child = (ASTNode) ast.getChild(i);
if (child.getToken().getType() == HiveParser.Identifier) {
dbName = unescapeIdentifier(child.getText());
} else if (child.getToken().getType() == HiveParser.TOK_PARTSPEC) {
partSpec = getPartSpec(child);
} else {
throw new SemanticException(ErrorMsg.GENERIC_ERROR.getMsg());
}
}
}
if (partSpec != null) {
validateTable(tableNames, partSpec);
}
showTblStatusDesc = new ShowTableStatusDesc(ctx.getResFile().toString(), dbName,
tableNames, partSpec);
rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(),
showTblStatusDesc), conf));
setFetchTask(createFetchTask(showTblStatusDesc.getSchema()));
}