Multi Statement Writes from Spark to Snowflake

pvignesh92
Honored Contributor

Does Spark support multi statement writes to Snowflake in a single session? To elaborate, I have a requirement where I need to do

  1. A selective deletion of data from a Snowflake table and
  2. Insert records to Snowflake table ( Ranges from around 1 M rows)

I want to wrap these both into a single transaction so that I could get Consistency here. I can't use overwrite mode as it will overwrite my entire table in Snowflake. I have seen runQuery of sfutils support multiStatements but it is more to handle data within Snowflake and not from Databricks to Snowflake.

Thanks,

Vignesh