protected void authorizeDDL(HiveSemanticAnalyzerHookContext context,
                List<Task<?>> rootTasks) throws SemanticException {

    if (!HCatAuthUtil.isAuthorizationEnabled(context.getConf())) {
      return;
    }

    Hive hive;
    try {
      hive = context.getHive();

      for (Task<?> task : rootTasks) {
        if (task.getWork() instanceof DDLWork) {
          DDLWork work = (DDLWork) task.getWork();
          if (work != null) {
            authorizeDDLWork(context, hive, work);
          }
        }
      }
    } catch (SemanticException ex) {
      throw ex;
    } catch (AuthorizationException ex) {
      throw ex;
    } catch (Exception ex) {
      throw new SemanticException(ex);
    }
  }
Checks for the given rootTasks, and calls authorizeDDLWork() for each DDLWork to
be authorized. The hooks should override this, or authorizeDDLWork to perform the
actual authorization.
hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzerBase.java