Simple Snowpipe
Simple Snowpipe
Simple Snowpipe
to Snowpipe
Create your first Snowpipe, step-by-step
masteringsnowflake.com
The Simple Guide to Snowpipe
When we need to handle micro-batches, or
continuous data loads Snowflake provides an
efficient way to do this with Snowpipe.
Snowpipe...
Adam Morton
The Simple Guide to Snowpipe
Snowpipe is a fully managed service. It doesn’t
require a user-defined virtual warehouse
because it uses Snowflake managed compute
resources.
Adam Morton
The Simple Guide to Snowpipe
Snowpipe removes the need for tuning or any
other additional management, and you don’t
need to worry about the resources because it’s
completely serverless.
Adam Morton
The Simple Guide to Snowpipe
You only pay for the compute time used to
load data.
Adam Morton
Hold up, what are we
Adam Morton
The Simple Guide to Snowpipe
Snowpipe checks the queue and copies these
messages to a Snowflake queue.
Adam Morton
Let's take a look at a
Adam Morton
The Simple Guide to Snowpipe
Now, be prepared to buckle up.
You ready?
Let's begin....
Adam Morton
This feature is available
Adam Morton
The Simple Guide to Snowpipe
To configure Snowpipe to auto ingest files
from a S3 bucket there's a few things we need
to create and configure.
Adam Morton
Your 6 Steps to
Adam Morton
Step 1
Adam Morton
The Simple Guide to Snowpipe
Adam Morton
The Simple Guide to Snowpipe
3. Choose Account settings from the left-hand
navigation pane.
Adam Morton
The Simple Guide to Snowpipe
6. Click Create Policy
Adam Morton
The Simple Guide to Snowpipe
The following policy (in JSON format) provides
Snowflake with the required permissions to
load or unload data using a single bucket and
folder path.
Adam Morton
The Simple Guide to Snowpipe
Adam Morton
The Simple Guide to Snowpipe
9. Click Review policy.
Adam Morton
The Simple Guide to Snowpipe
Adam Morton
Attach our policy to an
Adam Morton
The Simple Guide to Snowpipe
4. Select Another AWS account as the trusted
entity type.
5. In the Account ID field, enter your own AWS
account ID.
6. Select the Require external ID option. Enter a
dummy ID such as 0000.
Adam Morton
Open Sesame!
Adam Morton
The Simple Guide to Snowpipe
24 pages in and you've made it to step 2.
Adam Morton
Step 2 - Creating a
Adam Morton
The Simple Guide to Snowpipe
This is how you create a storage integration
object in Snowflake.
Adam Morton
The Simple Guide to Snowpipe
Hold up and pay attention here!
Adam Morton
The Simple Guide to Snowpipe
Ok, we need to execute a command in
Snowflake.
Adam Morton
Behold....the Storage
Adam Morton
Grant the IAM User
Adam Morton
Edit trust permissions
snowflake_user_arn is the
STORAGE_AWS_IAM_USER_ARN value
you recorded.
snowflake_external_id is the
STORAGE_AWS_EXTERNAL_ID value
you recorded.
Adam Morton
Edit trust permissions
Phew!
Adam Morton
The Simple Guide to Snowpipe
I'm starting to think I should rename this to
'The least complex guide to Snowpipe'
Adam Morton
Step 3 - Create external
Adam Morton
Step 4 - Create the pipe
Adam Morton
The Simple Guide to Snowpipe
The pipe defines the COPY INTO <table>
statement used by Snowpipe to load data from
the ingestion queue into the target table.
Adam Morton
The Simple Guide to Snowpipe
Wow, what an anticlimax!
Adam Morton
The Simple Guide to Snowpipe
**Quick recap people**
We've got:
An IAM policy
Adam Morton
Step 5 - Event
Adam Morton
The Simple Guide to Snowpipe
Every object created in AWS is uniquely
identified by a Amazon Resource Name (ARN).
SHOW PIPES;
Adam Morton
Back to AWS S3 we go!
2. Choose Properties.
Adam Morton
The Simple Guide to Snowpipe
Enter the following:
Name: Name of the event notification (e.g.
Auto-ingest Snowflake).
Events: Select the ObjectCreate (All)
option.
Send to: Select SQS Queue from the
dropdown list.
SQS: Select Add SQS queue ARN from the
dropdown list.
SQS queue ARN: Paste the SQS queue
name from the SHOW PIPES output.
Adam Morton
Step 6 - Set up access
Adam Morton
The Simple Guide to Snowpipe
Use the GRANT <privileges> command to
grant privileges to the role as follows:
Adam Morton
Cast your mind back a
Adam Morton
The Simple Guide to Snowpipe
And we've done it, we've built the entire
process flow.
Adam Morton
The Simple Guide to Snowpipe
Your still here?
Adam Morton
The Simple Guide to Snowpipe
You want more??
Adam Morton
The Simple Guide to Snowpipe
Ok a little extra, how do you monitor your
Snowpipe usage?
Adam Morton
The Simple Guide to Snowpipe
To view the credits billed to your Snowflake
account within a specified date range you can
use either Snowsight, the Classic Web UI, or
SQL.
Adam Morton
I'm Adam Morton
Link in my profile
Adam Morton