Created
November 4, 2022 09:37
-
-
Save barograf/4e19bf7ceafed28d8426830fc460adfb to your computer and use it in GitHub Desktop.
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
client = boto3.client("glue", region_name=args["REGION"]) | |
paginator = client.get_paginator("get_tables") | |
page_iterator = paginator.paginate(DatabaseName=args["CATALOG"]) | |
for page in page_iterator: | |
for table in page["TableList"]: | |
if not table_valid(table, args): | |
continue | |
[db, schema, tbl_name] = table["StorageDescriptor"]["Location"].split(".") | |
dest_path = f"{args['DEST']}/{tbl_name}" | |
print(f"Dumping table {tbl_name} to {dest_path}") | |
# dump code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment