private ApplicationId determineLlapId(HiveConf conf, ExecutionMode mode) {
      // Note: for now, LLAP is only supported in Tez tasks. Will never come to MR; others may
      // be added here, although this is only necessary to have extra debug information.
      if (mode == ExecutionMode.LLAP) {
        // In HS2, the client should have been cached already for the common case.
        // Otherwise, this may actually introduce delay to compilation for the first query.
        String hosts = HiveConf.getVar(conf, HiveConf.ConfVars.LLAP_DAEMON_SERVICE_HOSTS);
        if (hosts != null && !hosts.isEmpty()) {
          try {
            return LlapRegistryService.getClient(conf).getApplicationId();
          } catch (IOException e) {
            LOG.error("Error trying to get llap instance", e);
          }
        } else {
          LOG.info("Cannot determine LLAP instance on client - service hosts are not set");
          return null;
        }
      }
      return null;
    }
Log events from hive hook using protobuf serialized format, partitioned by date.
ql/src/java/org/apache/hadoop/hive/ql/hooks/HiveProtoLoggingHook.java