我遇到一个问题,在我的 awsglue 作业中运行更新查询时......我知道目前不可能直接使用 AWS GLUE 对 SQL 和 Mongo 在数据库中进行更新。
但是后来我做了很多搜索,然后我了解了动态框架,我们可以使用它来读取和写入并将更新。这只是如何做到这一点的测试或 POC。
现在问题是在做的时候
`glueContext.write_dynamic_frame.from_jdbc_conf(
frame=updated_dynamic_frame,
connection_options={
"url": jdbc_url,
"dbtable": db_table,
"user": jdbc_user,
"password": jdbc_password,
"driver": jdbc_driver,
"mode": "update"
}
) `
我收到错误:- {TypeError: DynamicFrameWriter.from_jdbc_conf() 缺少 1 个必需的位置参数:'catalog_connection'}
我也想知道如何创建“catalog_connection”。
那么任何人都可以帮助我解决错误或为我提供更好的方法吗?
现在问题是在做的时候
# save data in Redshift
glueContext.write_dynamic_frame.from_jdbc_conf(
frame=dynamic_frame_iteration,
catalog_connection="your_catalog_connection",
connection_options={
"database" : "your_database",
"dbtable" : "public.your_temp_table",
"preactions" : "...",
"postactions": "BEGIN; .... END;"
},
redshift_tmp_dir="s3://your_s3_bucket/temporary/",
transformation_ctx="dynamic_frame_iteration"
)
关于 your_catalog_connection -> 转到 AWSglue 服务页面中的连接选项卡,使用您的凭证创建一个新的 JDBC 连接,并将 your_catalog_connection 替换为您的连接条目的名称