Skip to main content

pipes

Creates, updates, deletes, gets or lists a pipes resource.

Overview

Namepipes
TypeResource
Idsnowflake.pipe.pipes

Fields

NameDatatypeDescription
namestringName of the pipe
auto_ingestbooleanTRUE if all files from stage need to be auto-ingested
aws_sns_topicstringOptional, if provided, auto_ingest pipe will only receive messages from this SNS topic.
budgetstringName of the budget if the pipe is monitored by a budget
commentstringuser comment associated to an object in the dictionary
copy_statementstringCOPY INTO 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
created_onstringDate and time when the pipe was created.
database_namestringDatabase in which the pipe is stored
error_integrationstringLink to integration object that point to a user provided Azure storage queue / SQS. When present, errors (e.g. ingest failure for Snowpipe or a user task failure or replication failure) will be sent to this queue to notify customers
integrationstringLink to integration object that ties a user provided storage queue to an auto_ingest enabled pipe. Required for auto_ingest to work on azure.
invalid_reasonstringDisplays some detailed information for your pipes that may have issues
ownerstringRole that owns the pipe
owner_role_typestringThe type of role that owns the pipe
patternstringPATTERN copy option value in the COPY INTO statement in the pipe definition, if the copy option was specified.
schema_namestringSchema in which the pipe is stored

Methods

NameAccessible byRequired ParamsOptional ParamsDescription
fetch_pipeSELECTdatabase_name, name, schema_name, endpoint-Fetch a pipe
list_pipesSELECTdatabase_name, schema_name, endpointlikeList pipes
create_pipeINSERTdatabase_name, schema_name, data__copy_statement, data__name, endpointcreateModeCreate a pipe
delete_pipeDELETEdatabase_name, name, schema_name, endpointifExistsDelete a pipe
refresh_pipeEXECdatabase_name, name, schema_name, endpointifExists, prefix, modified_afterRefresh the pipe

Optional Parameter Details
NameDescriptionTypeDefault
createModeQuery parameter allowing support for different modes of resource creation. Possible values include: - errorIfExists: Throws an error if you try to create a resource that already exists. - orReplace: Automatically replaces the existing resource with the current one. - ifNotExists: Creates a new resource when an alter is requested for a non-existent resource.stringerrorIfExists
ifExistsQuery parameter that specifies how to handle the request for a resource that does not exist: - true: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - false: The endpoint throws an error if the resource doesn't exist.booleanfalse
likeQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters.string-
modified_afterTimestamp (in ISO-8601 format) of the oldest data files to copy into the Snowpipe ingest queue based on the LAST_MODIFIED date (i.e. date when a file was staged)string-
prefixPath (or prefix) appended to the stage reference in the pipe definition. The path limits the set of files to load.string-

SELECT examples

List pipes

SELECT
name,
auto_ingest,
aws_sns_topic,
budget,
comment,
copy_statement,
created_on,
database_name,
error_integration,
integration,
invalid_reason,
owner,
owner_role_type,
pattern,
schema_name
FROM snowflake.pipe.pipes
WHERE database_name = '{{ database_name }}'
AND schema_name = '{{ schema_name }}'
AND endpoint = '{{ endpoint }}';

INSERT example

Use the following StackQL query and manifest file to create a new pipes resource.

/*+ create */
INSERT INTO snowflake.pipe.pipes (
data__name,
data__comment,
data__auto_ingest,
data__error_integration,
data__aws_sns_topic,
data__integration,
data__copy_statement,
database_name,
schema_name,
endpoint
)
SELECT
'{{ name }}',
'{{ comment }}',
'{{ auto_ingest }}',
'{{ error_integration }}',
'{{ aws_sns_topic }}',
'{{ integration }}',
'{{ copy_statement }}',
'{{ database_name }}',
'{{ schema_name }}',
'{{ endpoint }}'
;

DELETE example

Deletes the specified pipes resource.

/*+ delete */
DELETE FROM snowflake.pipe.pipes
WHERE database_name = '{{ database_name }}'
AND name = '{{ name }}'
AND schema_name = '{{ schema_name }}'
AND endpoint = '{{ endpoint }}';