From c069ee52b88252a39f8c10f65d32c6b96a02ff78 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Thu, 7 Nov 2024 14:53:54 +0000 Subject: [PATCH] Adding snapshot and checks files --- .../materialize-firebolt/checks.sh | 9 + .../materialize-firebolt/snapshot.json | 441 ++++++++++++++++++ 2 files changed, 450 insertions(+) create mode 100755 tests/materialize/materialize-firebolt/checks.sh create mode 100644 tests/materialize/materialize-firebolt/snapshot.json diff --git a/tests/materialize/materialize-firebolt/checks.sh b/tests/materialize/materialize-firebolt/checks.sh new file mode 100755 index 000000000..2f8e58f1e --- /dev/null +++ b/tests/materialize/materialize-firebolt/checks.sh @@ -0,0 +1,9 @@ +# cleanup the snapshot by replacing s3 paths and bucket with a placeholder so that the test is reproducible +SED_CMD="sed" +if [ "$(uname -s)" = "Darwin" ]; then + SED_CMD="gsed" +fi + +$SED_CMD -i'' 's/"Bucket": "[^"]*"/"Bucket": ""/g' ${SNAPSHOT} +$SED_CMD -i'' 's/"[^"]*\.json"/""/g' ${SNAPSHOT} +$SED_CMD -i'' "s/'[^']*\.json'/''/g" ${SNAPSHOT} diff --git a/tests/materialize/materialize-firebolt/snapshot.json b/tests/materialize/materialize-firebolt/snapshot.json new file mode 100644 index 000000000..c745fe63f --- /dev/null +++ b/tests/materialize/materialize-firebolt/snapshot.json @@ -0,0 +1,441 @@ +[ + "applied.actionDescription", + "created tables: {\"table\":\"simple\",\"table_type\":\"fact\"},{\"table\":\"duplicate_keys_standard\",\"table_type\":\"fact\"},{\"table\":\"formatted_strings\",\"table_type\":\"fact\"},{\"table\":\"long_string\",\"table_type\":\"fact\"},{\"table\":\"deletions\",\"table_type\":\"fact\"}" +] +[ + "connectorState", + { + "updated": { + "Files": [ + { + "Bucket": "", + "Key": "" + }, + { + "Bucket": "", + "Key": "" + }, + { + "Bucket": "", + "Key": "" + }, + { + "Bucket": "", + "Key": "" + }, + { + "Bucket": "", + "Key": "" + } + ], + "Queries": [ + "INSERT INTO simple (id,\"_meta/flow_truncated\",canary,flow_published_at,\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",canary,flow_published_at,\"$source_file_name\" FROM simple_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM simple WHERE $source_file_name IN ('')) < 1);", + "INSERT INTO duplicate_keys_standard (id,\"_meta/flow_truncated\",flow_published_at,\"int\",str,\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",flow_published_at,\"int\",str,\"$source_file_name\" FROM duplicate_keys_standard_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM duplicate_keys_standard WHERE $source_file_name IN ('')) < 1);", + "INSERT INTO formatted_strings (id,\"_meta/flow_truncated\",\"date\",\"datetime\",flow_published_at,int_str,num_str,\"time\",\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",\"date\",\"datetime\",flow_published_at,int_str,num_str,\"time\",\"$source_file_name\" FROM formatted_strings_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM formatted_strings WHERE $source_file_name IN ('')) < 1);", + "INSERT INTO long_string (id,\"_meta/flow_truncated\",flow_published_at,str_field,\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",flow_published_at,str_field,\"$source_file_name\" FROM long_string_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM long_string WHERE $source_file_name IN ('')) < 1);", + "INSERT INTO deletions (id,\"_meta/flow_truncated\",\"_meta/op\",flow_published_at,\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",\"_meta/op\",flow_published_at,\"$source_file_name\" FROM deletions_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM deletions WHERE $source_file_name IN ('')) < 1);" + ] + } + } +] +[ + "connectorState", + { + "updated": { + "Files": [ + { + "Bucket": "", + "Key": "" + }, + { + "Bucket": "", + "Key": "" + }, + { + "Bucket": "", + "Key": "" + }, + { + "Bucket": "", + "Key": "" + }, + { + "Bucket": "", + "Key": "" + } + ], + "Queries": [ + "INSERT INTO simple (id,\"_meta/flow_truncated\",canary,flow_published_at,\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",canary,flow_published_at,\"$source_file_name\" FROM simple_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM simple WHERE $source_file_name IN ('')) < 1);", + "INSERT INTO duplicate_keys_standard (id,\"_meta/flow_truncated\",flow_published_at,\"int\",str,\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",flow_published_at,\"int\",str,\"$source_file_name\" FROM duplicate_keys_standard_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM duplicate_keys_standard WHERE $source_file_name IN ('')) < 1);", + "INSERT INTO formatted_strings (id,\"_meta/flow_truncated\",\"date\",\"datetime\",flow_published_at,int_str,num_str,\"time\",\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",\"date\",\"datetime\",flow_published_at,int_str,num_str,\"time\",\"$source_file_name\" FROM formatted_strings_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM formatted_strings WHERE $source_file_name IN ('')) < 1);", + "INSERT INTO long_string (id,\"_meta/flow_truncated\",flow_published_at,str_field,\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",flow_published_at,str_field,\"$source_file_name\" FROM long_string_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM long_string WHERE $source_file_name IN ('')) < 1);", + "INSERT INTO deletions (id,\"_meta/flow_truncated\",\"_meta/op\",flow_published_at,\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",\"_meta/op\",flow_published_at,\"$source_file_name\" FROM deletions_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM deletions WHERE $source_file_name IN ('')) < 1);" + ] + } + } +] +[ + "connectorState", + { + "updated": { + "Files": [ + { + "Bucket": "", + "Key": "" + }, + { + "Bucket": "", + "Key": "" + }, + { + "Bucket": "", + "Key": "" + }, + { + "Bucket": "", + "Key": "" + }, + { + "Bucket": "", + "Key": "" + } + ], + "Queries": [ + "INSERT INTO simple (id,\"_meta/flow_truncated\",canary,flow_published_at,\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",canary,flow_published_at,\"$source_file_name\" FROM simple_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM simple WHERE $source_file_name IN ('')) < 1);", + "INSERT INTO duplicate_keys_standard (id,\"_meta/flow_truncated\",flow_published_at,\"int\",str,\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",flow_published_at,\"int\",str,\"$source_file_name\" FROM duplicate_keys_standard_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM duplicate_keys_standard WHERE $source_file_name IN ('')) < 1);", + "INSERT INTO formatted_strings (id,\"_meta/flow_truncated\",\"date\",\"datetime\",flow_published_at,int_str,num_str,\"time\",\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",\"date\",\"datetime\",flow_published_at,int_str,num_str,\"time\",\"$source_file_name\" FROM formatted_strings_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM formatted_strings WHERE $source_file_name IN ('')) < 1);", + "INSERT INTO long_string (id,\"_meta/flow_truncated\",flow_published_at,str_field,\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",flow_published_at,str_field,\"$source_file_name\" FROM long_string_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM long_string WHERE $source_file_name IN ('')) < 1);", + "INSERT INTO deletions (id,\"_meta/flow_truncated\",\"_meta/op\",flow_published_at,\"$source_file_name\") SELECT id,\"_meta/flow_truncated\",\"_meta/op\",flow_published_at,\"$source_file_name\" FROM deletions_external WHERE $source_file_name IN ('') AND ((SELECT count(*) FROM deletions WHERE $source_file_name IN ('')) < 1);" + ] + } + } +] +{ + "_table": "simple", + "rows": [ + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "canary": "amputation's", + "flow_published_at": "1970-01-01T00:00:00.000000000Z", + "id": 1 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "canary": "armament's", + "flow_published_at": "1970-01-01T00:00:01.000000000Z", + "id": 2 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "canary": "splatters", + "flow_published_at": "1970-01-01T00:00:02.000000000Z", + "id": 3 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "canary": "strengthen", + "flow_published_at": "1970-01-01T00:00:03.000000000Z", + "id": 4 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "canary": "Kringle's", + "flow_published_at": "1970-01-01T00:00:04.000000000Z", + "id": 5 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "canary": "grosbeak's", + "flow_published_at": "1970-01-01T00:00:05.000000000Z", + "id": 6 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "canary": "pieced", + "flow_published_at": "1970-01-01T01:00:00.000000000Z", + "id": 7 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "canary": "roaches", + "flow_published_at": "1970-01-01T01:00:01.000000000Z", + "id": 8 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "canary": "devilish", + "flow_published_at": "1970-01-01T01:00:02.000000000Z", + "id": 9 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "canary": "glucose's", + "flow_published_at": "1970-01-01T01:00:03.000000000Z", + "id": 10 + } + ] +} +{ + "_table": "duplicate_keys_standard", + "rows": [ + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "flow_published_at": "1970-01-01T00:00:06.000000000Z", + "id": 1, + "int": 1, + "str": "str 1" + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "flow_published_at": "1970-01-01T01:00:04.000000000Z", + "id": 1, + "int": 6, + "str": "str 6" + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "flow_published_at": "1970-01-01T00:00:07.000000000Z", + "id": 2, + "int": 2, + "str": "str 2" + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "flow_published_at": "1970-01-01T01:00:05.000000000Z", + "id": 2, + "int": 7, + "str": "str 7" + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "flow_published_at": "1970-01-01T00:00:08.000000000Z", + "id": 3, + "int": 3, + "str": "str 3" + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "flow_published_at": "1970-01-01T01:00:06.000000000Z", + "id": 3, + "int": 8, + "str": "str 8" + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "flow_published_at": "1970-01-01T00:00:09.000000000Z", + "id": 4, + "int": 4, + "str": "str 4" + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "flow_published_at": "1970-01-01T01:00:07.000000000Z", + "id": 4, + "int": 9, + "str": "str 9" + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "flow_published_at": "1970-01-01T00:00:10.000000000Z", + "id": 5, + "int": 5, + "str": "str 5" + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "flow_published_at": "1970-01-01T01:00:08.000000000Z", + "id": 5, + "int": 10, + "str": "str 10" + } + ] +} +{ + "_table": "formatted_strings", + "rows": [ + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "date": "0000-01-01", + "datetime": "0000-01-01T00:00:00Z", + "flow_published_at": "1970-01-01T01:00:13.000000000Z", + "id": 1, + "int_str": "10", + "num_str": "10.1", + "time": "00:00:00Z" + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "date": "1999-02-02", + "datetime": "1999-02-02T14:20:12.33Z", + "flow_published_at": "1970-01-01T01:00:14.000000000Z", + "id": 2, + "int_str": "20", + "num_str": "20.1", + "time": "14:20:12.33Z" + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "date": "1000-03-03", + "datetime": "1000-03-03T23:59:38.10Z", + "flow_published_at": "1970-01-01T00:00:11.000000000Z", + "id": 3, + "int_str": "30", + "num_str": "30.1", + "time": "23:59:38.10Z" + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "date": "2023-08-29", + "datetime": "2023-08-29T23:59:38Z", + "flow_published_at": "1970-01-01T00:00:12.000000000Z", + "id": 4, + "int_str": "40", + "num_str": "40.1", + "time": "23:59:38Z" + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "date": "9999-12-31", + "datetime": "9999-12-31T23:59:59Z", + "flow_published_at": "1970-01-01T01:00:15.000000000Z", + "id": 5, + "int_str": "50", + "num_str": "50.1", + "time": "23:59:59Z" + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "date": null, + "datetime": null, + "flow_published_at": "1970-01-01T01:00:16.000000000Z", + "id": 8, + "int_str": null, + "num_str": "NaN", + "time": null + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "date": null, + "datetime": null, + "flow_published_at": "1970-01-01T01:00:17.000000000Z", + "id": 9, + "int_str": null, + "num_str": "Infinity", + "time": null + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "date": null, + "datetime": null, + "flow_published_at": "1970-01-01T01:00:18.000000000Z", + "id": 10, + "int_str": null, + "num_str": "-Infinity", + "time": null + } + ] +} +{ + "_table": "long_string", + "rows": [ + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "flow_published_at": "1970-01-01T01:00:24.000000000Z", + "id": "very long string that exceeds 256 characters to test if dynamic sizing of varchar fields works. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostru.", + "str_field": "very long string that exceeds 256 characters to test if dynamic sizing of varchar fields works. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostru." + } + ] +} +{ + "_table": "deletions", + "rows": [ + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "_meta/op": "d", + "flow_published_at": "1970-01-01T01:00:25.000000000Z", + "id": 1 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "_meta/op": "c", + "flow_published_at": "1970-01-01T00:00:29.000000000Z", + "id": 1 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "_meta/op": "u", + "flow_published_at": "1970-01-01T01:00:26.000000000Z", + "id": 2 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "_meta/op": "c", + "flow_published_at": "1970-01-01T00:00:30.000000000Z", + "id": 2 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "_meta/op": "c", + "flow_published_at": "1970-01-01T01:00:27.000000000Z", + "id": 3 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "_meta/op": "c", + "flow_published_at": "1970-01-01T01:00:28.000000000Z", + "id": 4 + }, + { + "$source_file_name": "", + "_meta/flow_truncated": false, + "_meta/op": "d", + "flow_published_at": "1970-01-01T01:00:29.000000000Z", + "id": 4 + } + ] +} +[ + "applied.actionDescription", + "created tables: " +] +[ + "connectorState", + { + "updated": {} + } +]