public static Optional<Object> getResource(Configuration conf, String key) {
    return getQueryState(conf).map(state -> state.getResource(key));
  }
@param conf Configuration object used for getting the query state, should contain the query id
@param key The resource identifier
@return The requested resource, or an empty Optional if either the SessionState, QueryState or the resource itself
could not be found
ql/src/java/org/apache/hadoop/hive/ql/session/SessionStateUtil.java