use*_*463 5 python-3.x boto3 aws-glue aws-glue-data-catalog
I\xe2\x80\x99m 尝试从我的 aws 数据目录中的数据库获取表的列表。I\xe2\x80\x99m 尝试使用 boto3。我\xe2\x80\x99m 在 aws 上的 sagemaker 笔记本中运行下面的代码。它会永远运行(比如超过 30 分钟)并且不会返回任何结果。test_db 中只有 4 个表。我的目标是运行类似的代码作为 awsglueetl 作业的一部分,我将在编辑后的 awsetl 作业脚本中运行该代码。有谁知道问题可能是什么或建议如何做到这一点?
\n\n代码:
\n\nimport boto3\nfrom pprint import pprint\n\nglue = boto3.client('glue', region_name='us-east-2')\n\nresponse = glue.get_tables(\n DatabaseName=\xe2\x80\x98test_db\xe2\x80\x99\n)\n\nprint(pprint(response['TableList']))\nRun Code Online (Sandbox Code Playgroud)\n
小智 6
db = session.resource('dynamodb', region_name="us-east-2")
tables = list(db.tables.all())
print(tables)
Run Code Online (Sandbox Code Playgroud)
资源 https://boto3.amazonaws.com/v1/documentation/api/latest/guide/dynamodb.html
| 归档时间: |
|
| 查看次数: |
14876 次 |
| 最近记录: |