如何建立从 Aws Glue Catalog 表到自定义 python shell 脚本的连接?

How to make connection from Aws Glue Catalog tables to custom python shell script?

我在 aws glue 数据目录中有一些表,它们是通过从 S3 抓取数据创建的 buckets.I 我正在编写自己的 python shell 脚本来执行一些数据转换tables.But 中的数据如何通过 python 脚本连接到数据目录中的那些表?

如果您想访问 python shell 作业中的 Glue 目录表,那么您可以利用 aws-data-wrangler library.Refer 到 this 如何将其导入您的 python shell 工作。

另外 this and this 有更多关于如何从 Glue 中读取表格的示例 catalog.Below 是一个可以用来实现此目的的简单示例:

dtype = wr.catalog.get_table_types(database="awswrangler_test", table="csv_crawler")

df = wr.athena.read_sql_table(database="awswrangler_test", table="csv_crawler")