I have a lambda process which occasionally polls an API for recent data. This data has unique keys, and I\'d like to use Glue to update the table in MySQL. Is there an optio
I found a simpler way working with JDBC connections in Glue. The way the Glue team recommends to truncate a table is via following sample code when you're writing data to your Redshift cluster:
datasink5 = glueContext.write_dynamic_frame.from_jdbc_conf(frame = resolvechoice4, catalog_connection = "", connection_options = {"dbtable": "", "database": "testdb", "preactions":"TRUNCATE TABLE "}, redshift_tmp_dir = args["TempDir"], transformation_ctx = "datasink5")
where
connection-name your Glue connection name to your Redshift Cluster
target-table the table you're loading the data in
testdb name of the database
table-name name of the table to truncate (ideally the table you're loading into)