Complete the code to create a Snowpipe that loads data automatically from a stage.
CREATE PIPE my_pipe AUTO_INGEST = [1] AS COPY INTO my_table FROM @my_stage;Setting AUTO_INGEST to TRUE enables event-driven loading with Snowpipe.
Complete the code to create a notification integration for Snowpipe event notifications.
CREATE NOTIFICATION INTEGRATION my_integration TYPE = [1] ENABLED = TRUE;TYPE = QUEUE is used for notification integrations with Snowpipe on AWS SQS.
Fix the error in the COPY statement to load data from the stage correctly.
COPY INTO my_table FROM @my_stage FILE_FORMAT = (TYPE = [1]);CSV is a valid file format type for Snowflake COPY INTO commands.
Fill both blanks to configure Snowpipe to listen to the correct cloud storage bucket and notification integration.
ALTER PIPE my_pipe SET (NOTIFICATION_CHANNEL = '[1]', NOTIFICATION_INTEGRATION = [2]);
The NOTIFICATION_CHANNEL must be the ARN of the SQS queue, and NOTIFICATION_INTEGRATION must be the integration name.
Fill all three blanks to create a stage, pipe, and grant usage for Snowpipe event-driven loading.
CREATE STAGE my_stage URL='s3://my-bucket/data/' STORAGE_INTEGRATION=[1]; CREATE PIPE my_pipe AUTO_INGEST=TRUE AS COPY INTO my_table FROM @my_stage FILE_FORMAT = (TYPE=[2]); GRANT USAGE ON INTEGRATION [3] TO ROLE my_role;
The storage integration name must be consistent for the stage and grant statements, and CSV is the file format type.