public static void doAuthorization(HiveOperation op, BaseSemanticAnalyzer sem, String command)
      throws HiveException, AuthorizationException {
    if (skip(op, sem)) {
      return;
    }

    SessionState ss = SessionState.get();

    Set<ReadEntity> inputs = getInputs(sem);
    Set<WriteEntity> outputs = getOutputs(sem);

    if (!ss.isAuthorizationModeV2()) {
      CommandAuthorizerV1.doAuthorization(op, sem, ss, inputs, outputs);
    } else {
      CommandAuthorizerV2.doAuthorization(op, sem, ss, inputs, outputs, command);
    }
  }
@param command Passed so that authorization interface can provide more useful information in logs.
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/command/CommandAuthorizer.java