@Override
  public void analyzeInternal(ASTNode root) throws SemanticException {
    String databaseName = getUnescapedName((ASTNode) root.getChild(0));
    PrincipalDesc principalDesc = AuthorizationParseUtils.getPrincipalDesc((ASTNode) root.getChild(1));

    if (principalDesc.getName() == null) {
      throw new SemanticException("Owner name can't be null in alter database set owner command");
    }
    if (principalDesc.getType() == null) {
      throw new SemanticException("Owner type can't be null in alter database set owner command");
    }

    AlterDatabaseSetOwnerDesc desc = new AlterDatabaseSetOwnerDesc(databaseName, principalDesc, null);
    addAlterDatabaseDesc(desc);
  }
Analyzer for database set owner commands.
ql/src/java/org/apache/hadoop/hive/ql/ddl/database/alter/owner/AlterDatabaseSetOwnerAnalyzer.java