private static void updateModifiedParameters(Map<String, String> params, HiveConf conf) throws HiveException {
    String user = SessionState.getUserFromAuthenticator();
    params.put("last_modified_by", user);
    params.put("last_modified_time", Long.toString(System.currentTimeMillis() / 1000));
  }
Operation process of running some alter table command that requires write id.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/AbstractAlterTableOperation.java