我有一个现有的AWS胶水爬行器,它的胶水连接器连接到一个成功运行的MySQL数据库。我需要将它移动到胶合v3,以便它使用更新的MySQL JDBC驱动程序(Glue 2.0作业使用MySQL JDBCDriverVersion5.1,而AWS 3.0使用MySQL JDBC驱动程序8.0.23)。爬虫是用boto3 3的glue_client.update_crawler创建/更新的。爬行器设置为使用JDBC胶水连接器,该连接器也是用boto3创建的,并且没有glue_version参数。
关于boto3 3的胶水客户端爬虫函数https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/glue.html#Glue.Client.update_crawler的文档不包括GlueVersion选项。我在控制台中也没有看到任何相关的选项。爬虫配置有一个版本,但我不认为它是胶水版本,当我将它设置为3.0时,它会出错。我不确定在某个爬虫使用的地方是否有默认的胶水版本设置?
目前我正在使用:
glue_client = boto3.client('glue',region_name=region)
configuration= {"Version": 1.0,"Grouping": {"TableGroupingPolicy": "CombineCompatibleSchemas" }}
response = glue_client.update_crawler(
Name= crawler_name,
Role= glue_role_arn,
DatabaseName=str(crawler_details['DatabaseName']) + '-' + str(env_suffix),
Description=crawler_details['description'],
Targets=targets,
TablePrefix=crawler_details['TablePrefix'],
Schedule=crawler_details['Schedule'],
SchemaChangePolicy= crawler_details['SchemaChangePolicy'],
Configuration=configuration
)
如何将胶爬虫设置为使用GlueVersion = 3.0使用boto3?
发布于 2022-12-02 19:03:30
Glue Crawler没有版本,Glue Jobs也有。您需要在target属性中选择正确的连接,以便能够连接到较新的版本。
https://stackoverflow.com/questions/74659907
复制相似问题