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