SYSTEM$INGEST_REBIND_PIPE

functionnot supportedData loading & unloading

docs.snowflake.com ↗

System functions

Rebinds an auto-ingest pipe to the notification channel for its stage’s current storage location or, on a Google Cloud Storage or Microsoft Azure stage, to a notification integration that you specify. A pipe that receives Amazon S3 event notifications directly through Amazon Simple Queue Service (SQS), without an Amazon Simple Notification Service (SNS) topic or a Multi-Queue Notification Integration (MQNI), is an SQS-only pipe. Run this function once for each SQS-only pipe in the target account, which holds the pipe’s replica: for existing pipes when you configure multi-location resilience, and for each pipe that you create later, after the refresh that replicates it. A replicated pipe doesn’t load from that account’s storage location until you call the function, even if its status looks normal, and later refreshes keep the binding. The call does for one pipe what ALTER INTEGRATION ... SET ACTIVE does for every pipe that uses an MQNI. If the pipe’s stage resolves to the wrong region, for example because the stage doesn’t use a Multi-Location Storage Integration, fix the stage in the primary account first, and call the function after the change replicates. The failover runbook calls the function only for pipes added after setup that might not be bound in the target account and for pipes on the stages of a Multi-Location Storage Integration whose active location you had to correct before promotion. During failback, you call it in the source account for each pipe that you created during the outage and for each pipe that isn’t bound to the queue for your primary region, such as a pipe on the stages of a Multi-Location Storage Integration whose active location you had to correct, and you confirm that the new channel is in the region of your primary storage location. For the one-time setup procedure, see Rebind SQS-only pipes in Configure your target account for multi-location resilience. For the rebind during failback, see the fixes for an ACTIVE value that isn’t your primary location in Fail back data pipelines. For multi-location resilience on Amazon S3, the other notification path is Amazon SNS with an MQNI. That path redirects every pipe with one statement, so you don’t call this function for each pipe. To compare the two paths, see Choose a notification path for Amazon S3. To retry a notification channel binding that failed during replication, use SYSTEM$PIPE_REBINDING_WITH_NOTIFICATION_CHANNEL. That function takes only the pipe name and requires the OWNERSHIP or OPERATE privilege on the pipe rather than the ACCOUNTADMIN role.

Syntax

SYSTEM$INGEST_REBIND_PIPE( '<pipe_name>' , '<sns_topic>' , '<integration_name>' )

Parameters

NameRequiredDescription
pipe_namerequiredName of the pipe to rebind. Enclose the name in single quotes. For a fully qualified name, include the database and schema inside the single quotes: '<db>.<schema>.<pipe_name>'. If you don’t qualify the name, the function looks for the pipe in the current database and schema. If the pipe name is case-sensitive or includes special characters or spaces, enclose the pipe name in double quotes inside the single quotes: '"<pipe_name>"'.
sns_topicrequiredAmazon Resource Name (ARN) of the Amazon SNS topic to bind the pipe to. If you pass an empty string, the function keeps the pipe’s current SNS topic. For Amazon SQS auto-ingest, pass an empty string (''). Snowflake derives the new notification channel from the stage’s current bucket region.
integration_namerequiredName of the notification integration to bind the pipe to. To keep the pipe on its current integration, pass the value from the pipe’s integration column. Run DESCRIBE PIPE and inspect the integration column: If the column is NULL, pass an empty string (''). If the column contains an integration name, pass that name exactly. On an Amazon S3 stage, if the column names an MQNI, run ALTER INTEGRATION ... SET ACTIVE instead, because this function doesn’t use the SNS topic of the integration that you name. For a pipe on a Google Cloud Storage or Microsoft Azure stage, always pass an integration name. The function doesn’t fall back to the pipe’s current integration: if you pass an empty string, the function unbinds the pipe and then fails with an error.

Returns

A string in one of the following forms: - Rebind succeeded. New storage location: <url>. New channel: <channel>. for an auto-ingest pipe. - Rebind succeeded. New storage location: <url>. for a pipe that doesn’t use auto-ingest. The function updates the pipe’s storage location and doesn’t bind a channel. - Rebind failed. Error: <message> for a binding failure that the function reports in its return value. <url> is the full path that the pipe loads from. <channel> is the new notification channel, such as the ARN of an Amazon SQS queue. Some failures return text that starts with Rebind failed. Others raise an error, for example when the integration that you name doesn’t exist or is on a different cloud provider from the stage. Check for both outcomes.

Usage notes

Access control requirements

Only users with the ACCOUNTADMIN role can run this function. The function requires the MODIFY privilege on the account, which can’t be granted directly to a custom role. A role that has only the OWNERSHIP privilege or the OPERATE privilege on the pipe can’t call this function.

See also

Referenced by