CREATE PIPE

statementsupportedData loading & unloading

docs.snowflake.com ↗

Object: PIPE

Creates a new pipe in the system for defining the COPY INTO <table> statement used by Snowpipe to load data from an ingestion queue, or by Snowpipe Streaming with high-performance architecture to load data from a streaming source directly into tables. This command supports the following variants: - CREATE OR ALTER PIPE: Creates a pipe if it doesn’t exist or alters an existing pipe. - DEFINE PIPE: Declarative definition of a pipe’s target state inside a DCM project.

Syntax

supportedpartialnot supportednot scored

CREATE [ OR REPLACE ] PIPE [ IF NOT EXISTS ] <name>
  [ AUTO_INGEST = [ TRUE | FALSE ] ]
  [ ERROR_INTEGRATION = <integration_name> ]
  [ AWS_SNS_TOPIC = '<string>' ]
  [ INTEGRATION = '<string>' ]
  [ COMMENT = '<string_literal>' ]
  AS <copy_statement>

For more information, see CREATE OR ALTER <object>.

CREATE OR ALTER PIPE <name>
  [ AUTO_INGEST = [ TRUE | FALSE ] ]
  [ ERROR_INTEGRATION = <integration_name> ]
  [ AWS_SNS_TOPIC = '<string>' ]
  [ INTEGRATION = '<string>' ]
  [ PIPE_EXECUTION_PAUSED = TRUE | FALSE ]
  [ COMMENT = '<string_literal>' ]
  AS <copy_statement>

Parameters

NameRequiredDescription
namerequiredIdentifier for the pipe; must be unique for the schema in which the pipe is created. The identifier must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (e.g. "My object"). Identifiers enclosed in double quotes are also case-sensitive. For more details, see Identifier requirements.
copy_statementrequiredCOPY INTO <table> statement used to load data from queued files into a Snowflake table. This statement serves as the text/definition for the pipe and is displayed in the SHOW PIPES output.
AUTO_INGEST = TRUE | FALSEoptionalSpecifies whether to automatically load data files from the internal or external stage: TRUE enables automatic data loading. Snowpipe supports loading from external stages (Amazon S3, Google Cloud Storage, or Microsoft Azure). FALSE disables automatic data loading. You must make calls to the Snowpipe REST API endpoints to load data files. Snowpipe supports loading from internal stages (i.e. Snowflake named stages or table stages, but not user stages) or external stage (Amazon S3, Google Cloud Storage, or Microsoft Azure).
ERROR_INTEGRATION = integration_nameoptionalRequired only when configuring Snowpipe to send error notifications to a cloud messaging service. Specifies the name of the notification integration used to communicate with the messaging service. For more information, see Snowpipe error notifications.
AWS_SNS_TOPIC = 'string'optionalRequired only when configuring AUTO_INGEST for Amazon S3 external stages using SNS. Specifies the Amazon Resource Name (ARN) for the SNS topic for your S3 bucket. The CREATE PIPE statement subscribes the Amazon Simple Queue Service (SQS) queue to the specified SNS topic. The pipe copies files to the ingest queue triggered by event notifications via the SNS topic. For more information, see Automate Snowpipe for Amazon S3. You can’t specify both AWS_SNS_TOPIC and INTEGRATION for an Amazon S3 stage.
INTEGRATION = 'string'optionalRequired only when configuring AUTO_INGEST for Google Cloud Storage or Microsoft Azure external stages, or for an Amazon S3 external stage when the pipe uses a Multi-Queue Notification Integration. Specifies the existing notification integration used to access the storage queue. For an Amazon S3 stage, specify a Multi-Queue Notification Integration, and don’t specify AWS_SNS_TOPIC. For more information, see: Automate Snowpipe for Google Cloud Storage Automate Snowpipe for Microsoft Azure Blob Storage Create a Multi-Queue Notification Integration for multi-location resilience The integration name must be typed in all uppercase.
COMMENT = 'string_literal'optionalSpecifies a comment for the pipe. Default: No value

Usage notes

Pipes for Snowpipe Streaming with high-performance architecture

You can define a pipe for Snowpipe Streaming to load data directly from the Snowpipe Streaming API, without requiring a staged file location. This method is designed for low-latency, row-based ingestion. The COPY INTO statement for a streaming pipe must use the DATA_SOURCE table function in the FROM clause, with the TYPE => 'STREAMING' argument. Note - Pipes created for streaming don’t require an AUTO_INGEST parameter or a FROM @stage clause. - The copy_statement within a streaming pipe’s definition is used to transform and load the data received from the API. - Snowpipe Streaming also provides a default pipe for each table, which is automatically created on demand. You only need to create a custom pipe if you require features like in-flight transformations or pre-clustering. For examples, see CREATE OR ALTER PIPE.

See also

Referenced by