Last active
April 5, 2023 08:29
-
-
Save dsmdavid/f9d0de9cee2231fc5825b84d8d299ed3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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