Categories:

System functions (System Control)

SYSTEM$SET_CATALOG_INTEGRATION

Replaces the catalog integration associated with an externally managed Apache Iceberg™ table.

Use this function to update a table to work with an Iceberg REST catalog integration, which supports a wider range of Iceberg features, such as write support for externally managed Iceberg tables. You might also use this function to roll back to the original Glue catalog integration, if needed.

You can also use this function to migrate your table from one Iceberg REST catalog integration to another.

Syntax

SYSTEM$SET_CATALOG_INTEGRATION(
  '<table_name>' ,
  '<new_catalog_integration_name>'
)

Arguments

'table_name'

Name of the Iceberg table whose catalog integration you want to replace.

'new_catalog_integration_name'

Name of the catalog integration that you want to migrate the given table_name to.

Returns

The function returns a status message that the catalog integration for the table is successfully migrated. For an example, see Examples.

Access control requirements

A role used to execute this operation must have the following privileges at a minimum:

PrivilegeObject
OWNERSHIPTable whose catalog integration is being replaced.
USAGECurrent catalog integration.
USAGETarget catalog integration.

Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Usage notes

  • You can only replace the catalog integration for externally managed Iceberg tables in a standard Snowflake database. You can’t replace the catalog integration for Iceberg tables in a catalog-linked database or replace the catalog integration for any other type of Iceberg table.

  • The type of the current catalog integration associated with the table restricts the types of catalog integrations that you can use as a replacement. The following table lists the supported transitions when you replace one type of catalog integration with another:

    Current catalog integration typeNew catalog integration typeNotes
    AWS GlueAWS Glue Iceberg REST
    AWS Glue Iceberg RESTAWS GlueFall back to a catalog integration that uses an AWS Glue catalog source.
    Iceberg RESTIceberg RESTMigrate the table to an alternative catalog integration.
    No other transition combinations are supported.
  • table_name and new_catalog_integration_name are string literals, so you must include the values in single quotes.

  • Both the current and target catalog integrations must point to the same external catalog.

  • Both the current and target catalog integrations can’t have credential vending enabled.

Examples

Replace the AWS Glue catalog integration associated with an Iceberg table named glue_table with an AWS Glue Iceberg REST catalog integration named glue_rest_catalog_int:

SELECT SYSTEM$SET_CATALOG_INTEGRATION('glue_table', 'glue_rest_catalog_int');

Sample output:

+------------------------------------------------------------------------------------------------------------------------------+
|                                                SYSTEM$SET_CATALOG_INTEGRATION                                                |
+------------------------------------------------------------------------------------------------------------------------------+
| Catalog integration for table GLUE_TABLE has been migrated from 'GLUE_CATALOG_INTEGRATION' to 'GLUE_REST_CATALOG_INT'        |
+------------------------------------------------------------------------------------------------------------------------------+

Troubleshooting

If the function fails, it returns an error response. Common error messages include:

Error MessageSituation and Solution
SYSTEM$SET_CATALOG_INTEGRATION does not support transitioning from catalog integration ‘[CURRENT_CATALOG_INTEGRATION]’ to ‘[TARGET_CATALOG_INTEGRATION]’ due to unsupported type combinationThe current or target catalog integration provided doesn’t match the catalog integration types that are supported. For the supported types, see the usage notes.
SYSTEM$SET_CATALOG_INTEGRATION cannot transition from ‘[CURRENT_CATALOG_INTEGRATION]’ to ‘[TARGET_CATALOG_INTEGRATION]’ due to incompatible catalog integration configurationsThe given catalog integrations are of the supported type but don’t align with one of the supported transition combinations. For the supported transition combinations, see the usage notes.
Currently doesn’t support performing transition when catalog integration ‘[CATALOG_INTEGRATION]’ has credential vending enabledThe provided catalog integration has credential vending enabled. Provide a catalog integration with credential vending disabled and try again.
SYSTEM$SET_CATALOG_INTEGRATION can only be used on unmanaged Iceberg tablesThe table provided isn’t an externally managed Iceberg table. Provide an externally managed Iceberg table and try again.