public void setupQueryCurrentTimestamp() {
    queryCurrentTimestamp = Instant.now();

    // Provide a facility to set current timestamp during tests
    if (sessionConf.getBoolVar(ConfVars.HIVE_IN_TEST)) {
      String overrideTimestampString =
          HiveConf.getVar(sessionConf, HiveConf.ConfVars.HIVE_TEST_CURRENT_TIMESTAMP, (String)null);
      if (overrideTimestampString != null && overrideTimestampString.length() > 0) {
        TimestampTZ zonedDateTime = TimestampTZUtil.convert(
            Timestamp.valueOf(overrideTimestampString), sessionConf.getLocalTimeZone());
        queryCurrentTimestamp = zonedDateTime.getZonedDateTime().toInstant();
      }
    }
  }
Initialize current timestamp, other necessary query initialization.
ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java