如何解决aws 胶中的catalog_connection 参数是什么?
我希望每 4 小时定期运行一次 etl 作业,它将联合(组合)来自 s3 存储桶(镶木地板格式)的数据和来自 redshift 的数据。找出唯一的,然后将其再次写入 redshift,替换旧的 redshift 数据。要将数据帧写入红移,this
glueContext.write_dynamic_frame.from_jdbc_conf(frame,catalog_connection,connection_options={},redshift_tmp_dir = "",transformation_ctx="")
Writes a DynamicFrame using the specified JDBC connection information.
frame – The DynamicFrame to write.
catalog_connection – A catalog connection to use.
connection_options – Connection options,such as path and database table (optional).
redshift_tmp_dir – An Amazon Redshift temporary directory to use (optional).
transformation_ctx – A transformation context to use (optional).
似乎是这样。但是 catalog_connection
是什么意思?它是指胶水目录吗?如果是,那么胶水目录是什么?
解决方法
catalog_connection 是指在胶水目录中定义的 glue connection。
假设在胶连接中有一个名为 redshift_connection
的连接,它将被这样使用:
glueContext.write_dynamic_frame.from_jdbc_conf(frame = m_df,catalog_connection = "redshift_connection",connection_options = {"dbtable": df_name,"database": "testdb"},redshift_tmp_dir = "s3://glue-sample-target/temp-dir/")
以下是一些带有详细信息的示例:
https://aws.amazon.com/premiumsupport/knowledge-center/sql-commands-redshift-glue-job/
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。