amazon-web-services - 如何在数据加载前截断 AWS Glue 作业中的 RDS

我使用 AWS Glue 作为 ETL 将数据加载到 RDS 表,这是一个每日快照表,需要在当天的数据加载之前截断。

我尝试了 DynamicFrameWriter 类中的“Preactions”参数,但看起来它只是 Redshift。

引用:https://aws.amazon.com/premiumsupport/knowledge-center/sql-commands-redshift-glue-job/#

最佳答案

 conn = pymysql.connect(<URL>, user=<user_name>, passwd=<password>, db=<db_name>, connect_timeout=30)
        print("mysql_connection")
        print(conn)

        with conn.cursor() as cur:
            cur.execute("drop table if exists <tableName>")
            conn.commit()

关于amazon-web-services - 如何在数据加载前截断 AWS Glue 作业中的 RDS 表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57077498/

相关文章:

.net-core - 部署到 Azure 后,在 Angular 7 中使用 i18n 的本地化不

c++ - 如何使用跳过部分 device_vector 的自定义仿函数实现 thrust::tra

jenkins - 我无法打开蓝海管道编辑器

javascript - 使用 CSS Grid 调整图表大小问题

python - 需要使用 pyodbc 将较小的批处理插入到 Teradata 表中

jestjs - 如何模拟慢速网络连接?

c# - 具有 Azure Active Directory 的 Web 应用程序始终重定向到 '~

r - 提取 stat_smooth 线拟合的方法

android - react native : compileDebugJavaWithJavac

angular - Mat-select 滚动不跳转到选定的 mat-option