code: public static CatalogPlugin load(String name, SQLConf conf)
        throws CatalogNotFoundException, SparkException {
      String pluginClassName = conf.getConfString("spark.sql.catalog." + name, null);
      if (pluginClassName == null) {
        throw new CatalogNotFoundException(String.format(
            "Catalog '%s' plugin class not found: spark.sql.catalog.%s is not defined", name, name));
      }
  
      ClassLoader loader = Utils.getContextOrSparkClassLoader();
  
      try {
        Class<?> pluginClass = loader.loadClass(pluginClassName);
  
        if (!CatalogPlugin.class.isAssignableFrom(pluginClass)) {
          throw new SparkException(String.format(
              "Plugin class for catalog '%s' does not implement CatalogPlugin: %s",
              name, pluginClassName));
        }
  
        CatalogPlugin plugin = CatalogPlugin.class.cast(pluginClass.newInstance());
  
        plugin.initialize(name, catalogOptions(name, conf));
  
        return plugin;
  
      } catch (ClassNotFoundException e) {
        throw new SparkException(String.format(
            "Cannot find catalog plugin class for catalog '%s': %s", name, pluginClassName));
  
      } catch (IllegalAccessException e) {
        throw new SparkException(String.format(
            "Failed to call public no-arg constructor for catalog '%s': %s", name, pluginClassName),
            e);
  
      } catch (InstantiationException e) {
        throw new SparkException(String.format(
            "Failed while instantiating plugin for catalog '%s': %s", name, pluginClassName),
            e.getCause());
      }
    }
docs: Load and configure a catalog by name.
  <p>
  This loads, instantiates, and initializes the catalog plugin for each call; it does not cache
  or reuse instances.
  
  @param name a String catalog name
  @param conf a SQLConf
  @return an initialized CatalogPlugin
  @throws CatalogNotFoundException if the plugin class cannot be found
  @throws SparkException if the plugin class cannot be instantiated