public static void renameTable(Configuration conf, Properties props, TableIdentifier to) {
    String catalogName = props.getProperty(InputFormatConfig.CATALOG_NAME);

    Optional<Catalog> catalog = loadCatalog(conf, catalogName);
    if (catalog.isPresent()) {
      String name = props.getProperty(NAME);
      Preconditions.checkNotNull(name, "Table identifier not set");
      catalog.get().renameTable(TableIdentifier.parse(name), to);
    } else {
      throw new RuntimeException("Rename from " + props.getProperty(NAME) + " to " + to + " failed");
    }
  }
Register a table with the configured catalog if it does not exist.
@param conf a Hadoop conf
@param props the controlling properties
@param metadataLocation the location of a metadata file
@return the created Iceberg table
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/Catalogs.java