private static String getHS2Host(HiveConf conf) throws SemanticException {
    if (SessionState.get().isHiveServerQuery()) {
      return SessionState.get().getHiveServer2Host();
    } else if (conf.getBoolVar(ConfVars.HIVE_TEST_AUTHORIZATION_SQLSTD_HS2_MODE)) {
      return "dummyHostnameForTest";
    }

    throw new SemanticException("Kill query is only supported in HiveServer2 (not hive cli)");
  }
Validate if the given table/partition is eligible for update.

@param db Database.
@param tableName Table name of format db.table
@param partSpec Partition spec for the partition
@param replicationSpec Replications specification

@return boolean true if allow the operation
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/ddl/DDLUtils.java