From faaed4ec432b771289fb7614808b8c105b7d6284 Mon Sep 17 00:00:00 2001 From: Zihao Xu Date: Sat, 20 Apr 2024 00:01:39 -0400 Subject: [PATCH] chore(snowflake-sink): update spec and related demo sql(s) (#16415) --- integration_tests/snowflake-sink/create_sink.sql | 5 ++--- integration_tests/snowflake-sink/create_source.sql | 3 +++ integration_tests/snowflake-sink/snowflake_prep.sql | 10 +++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/integration_tests/snowflake-sink/create_sink.sql b/integration_tests/snowflake-sink/create_sink.sql index 457def4f82e2d..0986005d8c717 100644 --- a/integration_tests/snowflake-sink/create_sink.sql +++ b/integration_tests/snowflake-sink/create_sink.sql @@ -12,9 +12,8 @@ CREATE SINK snowflake_sink FROM ss_mv WITH ( snowflake.aws_access_key_id = 'EXAMPLE_AWS_ID', snowflake.aws_secret_access_key = 'EXAMPLE_SECRET_KEY', snowflake.aws_region = 'EXAMPLE_REGION', - snowflake.max_batch_row_num = '1030', snowflake.s3_path = 'EXAMPLE_S3_PATH', - -- depends on your mv setup, note that snowflake sink only supports - -- append-only at present. + -- depends on your mv setup, note that snowflake sink *only* supports + -- `append-only` mode at present. force_append_only = 'true' ); \ No newline at end of file diff --git a/integration_tests/snowflake-sink/create_source.sql b/integration_tests/snowflake-sink/create_source.sql index ed7c02341638a..0a5bc60f49922 100644 --- a/integration_tests/snowflake-sink/create_source.sql +++ b/integration_tests/snowflake-sink/create_source.sql @@ -1,3 +1,6 @@ +-- please note that this will create a source that generates 1,000 rows in 10 seconds +-- you may want to change the configuration for better testing / demo purpose + CREATE table user_behaviors ( user_id int, target_id VARCHAR, diff --git a/integration_tests/snowflake-sink/snowflake_prep.sql b/integration_tests/snowflake-sink/snowflake_prep.sql index 96026d0884415..b684a93b2d299 100644 --- a/integration_tests/snowflake-sink/snowflake_prep.sql +++ b/integration_tests/snowflake-sink/snowflake_prep.sql @@ -19,11 +19,15 @@ SELECT TRIM( CREATE OR REPLACE TABLE example_snowflake_sink_table (user_id INT, target_id VARCHAR, event_timestamp TIMESTAMP_TZ); -- snowflake stage, we only supports json as sink format at present -CREATE OR REPLACE STAGE example_snowflake_stage URL = '' - credentials = ( AWS_KEY_ID = '' AWS_SECRET_KEY = '' ) file_format = ( type = JSON ); +CREATE OR REPLACE STAGE example_snowflake_stage + url = '' + credentials = ( AWS_KEY_ID = '' AWS_SECRET_KEY = '' ) + file_format = ( type = JSON ); -- snowflake pipe -CREATE OR REPLACE PIPE example_snowflake_pipe AS COPY INTO example_snowflake_sink_table FROM @example_snowflake_stage MATCH_BY_COLUMN_NAME = CASE_INSENSITIVE; +CREATE OR REPLACE PIPE example_snowflake_pipe + AS COPY INTO example_snowflake_sink_table + FROM @example_snowflake_stage MATCH_BY_COLUMN_NAME = CASE_INSENSITIVE; -- select from table after sinking from rw SELECT * FROM example_snowflake_sink_table WHERE event_timestamp IS NOT NULL;