From 187cc6063a883ccc508be1503aa049341853d955 Mon Sep 17 00:00:00 2001 From: Simon Spencer Date: Thu, 6 Jun 2024 18:21:42 +0000 Subject: [PATCH] GITBOOK-542: change request with no subject merged in GitBook --- SUMMARY.md | 2 ++ .../pro/copy-data-from-snowflake-to-azure.md | 32 +++++++++++++++++++ .../pro/copy-data-from-snowflake-to-gcp.md | 30 +++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 choose-your-flipside-plan/pro/copy-data-from-snowflake-to-azure.md create mode 100644 choose-your-flipside-plan/pro/copy-data-from-snowflake-to-gcp.md diff --git a/SUMMARY.md b/SUMMARY.md index f4157a8..e683c35 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -8,6 +8,8 @@ * [Get Started in Snowflake](choose-your-flipside-plan/pro/get-started-in-snowflake.md) * [Incremental Table Pattern](choose-your-flipside-plan/pro/incremental-table-pattern.md) * [Copy Data from Snowflake to AWS](choose-your-flipside-plan/pro/copy-data-from-snowflake-to-aws.md) + * [Copy Data from Snowflake to GCP](choose-your-flipside-plan/pro/copy-data-from-snowflake-to-gcp.md) + * [Copy Data from Snowflake to Azure](choose-your-flipside-plan/pro/copy-data-from-snowflake-to-azure.md) * [Snowflake Data Shares](choose-your-flipside-plan/snowflake-data-shares/README.md) * [Mounting a Snowflake Data Share](choose-your-flipside-plan/snowflake-data-shares/mounting-a-snowflake-data-share.md) diff --git a/choose-your-flipside-plan/pro/copy-data-from-snowflake-to-azure.md b/choose-your-flipside-plan/pro/copy-data-from-snowflake-to-azure.md new file mode 100644 index 0000000..52a8206 --- /dev/null +++ b/choose-your-flipside-plan/pro/copy-data-from-snowflake-to-azure.md @@ -0,0 +1,32 @@ +# Copy Data from Snowflake to Azure + +o copy data from Snowflake into Azure Blob Storage without creating a storage integration, you can create an external stage with Azure credentials. Here's how you can do it: + +1. **Create the external stage** +2. **Copy data into the Azure Blob Storage** + +Here’s the process step-by-step: + +1. **Create the external stage:** + +Replace `your-account-name`, `your-container-name`, `your-path`, and `your-azure-sas-token` with your actual Azure account name, container name, path, and the SAS token, respectively. + +```sql +CREATE OR REPLACE STAGE my_azure_stage +URL = 'azure://your-account-name.blob.core.windows.net/your-container-name/your-path/' +CREDENTIALS = ( + AZURE_SAS_TOKEN = 'your-azure-sas-token' +); +``` + +2. **Copy data into the Azure Blob Storage:** + +Replace `your-file-name` with the desired file name in the Azure Blob Storage and `your_table` with the name of the table you want to export. + +```sql +COPY INTO @my_azure_stage/your-file-name +FROM your_table +FILE_FORMAT = (TYPE = CSV); +``` + +This approach for both GCP and Azure allows you to copy data from Snowflake to your cloud storage without creating a storage integration. diff --git a/choose-your-flipside-plan/pro/copy-data-from-snowflake-to-gcp.md b/choose-your-flipside-plan/pro/copy-data-from-snowflake-to-gcp.md new file mode 100644 index 0000000..720ded3 --- /dev/null +++ b/choose-your-flipside-plan/pro/copy-data-from-snowflake-to-gcp.md @@ -0,0 +1,30 @@ +# Copy Data from Snowflake to GCP + +To copy data from Snowflake into Google Cloud Storage (GCS) without creating a storage integration, you can create an external stage with GCP credentials. Here's how you can do it: + +1. **Create the external stage** +2. **Copy data into the GCS bucket** + +Here’s the process step-by-step: + +1. **Create the external stage:** + +Replace `your-bucket-name`, `your-path`, and `your-gcp-keyfile-json-string` with your actual GCS bucket name, path, and the contents of your GCP key file (in JSON format), respectively. + +```sql +CREATE OR REPLACE STAGE my_gcs_stage +URL = 'gcs://your-bucket-name/your-path/' +CREDENTIALS = ( + GCP_KEYFILE = 'your-gcp-keyfile-json-string' +); +``` + +2. **Copy data into the GCS bucket:** + +Replace `your-file-name` with the desired file name in the GCS bucket and `your_table` with the name of the table you want to export. + +```sql +COPY INTO @my_gcs_stage/your-file-name +FROM your_table +FILE_FORMAT = (TYPE = CSV); +```