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>'
)
Copy

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 was 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:

Privilege

Object

Notes

OWNERSHIP

Table whose catalog integration is being replaced.

USAGE

Current catalog integration.

USAGE

Target catalog integration.

The USAGE privilege on the parent database and schema are required to perform operations on any object in a 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 replacing one type with another:

    Current catalog integration type

    New catalog integration type

    Notes

    AWS Glue

    An AWS Glue Iceberg REST

    AWS Glue Iceberg REST

    An AWS Glue

    Fall back to a catalog integration that uses an AWS Glue catalog source.

    Iceberg REST

    Iceberg REST

    Migrate 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');
Copy

Sample output:

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

Troubleshooting

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

Error Message

Situation and Solution

SYSTEM$SET_CATALOG_INTEGRATION does not support transitioning from catalog integration ‘[CURRENT_CATALOG_INTEGRATION]’ to ‘[TARGET_CATALOG_INTEGRATION]’ due to unsupported type combination

The 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 configurations

The 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 enabled

The 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 tables

The table provided isn’t an externally managed Iceberg table. Provide an externally managed Iceberg table and try again.

Language: English