Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
-- preparation:
-- create three identical tables derived from Snowflake's sample data TPCH_SF100
-- introduce some small variations in one of them
set var_db = 'test_db';
set var_schema = 'david_test';
use database identifier($var_db);
use schema identifier($var_schema);
create or replace table "LINEITEM_ORIGINAL" as
select * from "SNOWFLAKE_SAMPLE_DATA"."TPCH_SF100"."LINEITEM";
create or replace table "LINEITEM_EXACT_COPY" clone "LINEITEM_ORIGINAL";
create or replace table "LINEITEM_FEW_CHANGES" clone "LINEITEM_ORIGINAL";
-- introduce some errors
update "LINEITEM_FEW_CHANGES"
set L_QUANTITY = '22'
where L_QUANTITY = '20'
and L_SHIPDATE >= '1998-08-16' and L_SHIPDATE < '1998-08-20';
-- returns 17487 rows updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment