This file contains hidden or 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
| CREATE OR REPLACE FUNCTION damerau_levenshtein(s1 TEXT, s2 TEXT) | |
| RETURNS INT AS $$ | |
| DECLARE | |
| s1_len INT := LENGTH(s1); | |
| s2_len INT := LENGTH(s2); | |
| d INT[][]; | |
| i INT; | |
| j INT; | |
| cost INT; | |
| BEGIN |
This file contains hidden or 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
| CREATE OR REPLACE FUNCTION damerau_levenshtein(source TEXT, target TEXT) | |
| RETURNS INT AS $$ | |
| DECLARE | |
| source_len INT := LENGTH(source); | |
| target_len INT := LENGTH(target); | |
| distance INT[][]; | |
| largest_source_chr_matching JSONB := '{}'; | |
| largest_target_chr_matching INT; | |
| inf INT; | |
| i INT; |
This file contains hidden or 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
| """ | |
| This script migrates databases/tables in AWS Glue backed by S3 data. It assumes you are migrating databases to a new | |
| S3 bucket, it also assumes the data is stored in s3://<bucket>/<database name with standardization across dbs>/<tables>/<optional partitions/data.<ext> | |
| bucket name/ | |
| database1/ | |
| tableA/ | |
| tableB/ | |
| database2/ | |
| table1/ |
This file contains hidden or 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
| """AWS DataSync an aws service to move/copy large amounts of data.""" | |
| import logging | |
| import os | |
| from typing_extensions import Literal | |
| import boto3 | |
| import tenacity | |
| from botocore import waiter | |
| from botocore.exceptions import WaiterError |
This file contains hidden or 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
| import logging | |
| from py4j.protocol import Py4JJavaError | |
| from pyspark import SparkContext | |
| logger = logging.getLogger(__name__) | |
| class ServiceApiError(Exception): | |
| """ServiceApiError exception.""" |