private void enrichFromQueryInfo(QueryInfo queryInfo, Record record) {
    if (queryInfo == null) {
      return;
    }
    // this state is the same as "state" displayed in the JSON returned by QueriesRESTfulAPIServlet
    record.setOperationId(queryInfo.getOperationId());
    record.setExecutionEngine(queryInfo.getExecutionEngine());
    record.setQueryState(queryInfo.getState());
    record.setQueryStartTime(queryInfo.getBeginTime());
    if (queryInfo.getEndTime() != null) {
      record.setQueryEndTime(queryInfo.getEndTime());
    }
    record.setTotalTime(queryInfo.getElapsedTime());
  }
With query history, a more detailed HiveOperation-based query classification is introduced without breaking the
original one. If there is an SqlKind stored in the QueryState, the record will contain it.
ql/src/java/org/apache/hadoop/hive/ql/queryhistory/RecordEnricher.java