code: private static CaseInsensitiveStringMap catalogOptions(String name, SQLConf conf) {
      Map<String, String> allConfs = mapAsJavaMapConverter(conf.getAllConfs()).asJava();
      Pattern prefix = Pattern.compile("^spark\\.sql\\.catalog\\." + name + "\\.(.+)");
  
      HashMap<String, String> options = new HashMap<>();
      for (Map.Entry<String, String> entry : allConfs.entrySet()) {
        Matcher matcher = prefix.matcher(entry.getKey());
        if (matcher.matches() && matcher.groupCount() > 0) {
          options.put(matcher.group(1), entry.getValue());
        }
      }
  
      return new CaseInsensitiveStringMap(options);
    }
docs: Extracts a named catalog's configuration from a SQLConf.
  
  @param name a catalog name
  @param conf a SQLConf
  @return a case insensitive string map of options starting with spark.sql.catalog.(name).