private boolean registerTableToTargetCatalog()

in iceberg-catalog-migrator/api/src/main/java/org/apache/polaris/iceberg/catalog/migrator/api/CatalogMigrator.java [211:227]


  private boolean registerTableToTargetCatalog(TableIdentifier tableIdentifier) {
    try {
      createNamespacesIfNotExistOnTargetCatalog(tableIdentifier.namespace());
      // register the table to the target catalog
      TableOperations ops = ((BaseTable) sourceCatalog().loadTable(tableIdentifier)).operations();
      targetCatalog().registerTable(tableIdentifier, ops.current().metadataFileLocation());
      LOG.info("Successfully registered the table {}", tableIdentifier);
      return true;
    } catch (Exception ex) {
      if (enableStacktrace()) {
        LOG.error("Unable to register the table {}", tableIdentifier, ex);
      } else {
        LOG.error("Unable to register the table {} : {}", tableIdentifier, ex.getMessage());
      }
      return false;
    }
  }