Isi
Honored Contributor III

Hey @bjn ,

1)

Yes, if you run both df.write.format("noop")... and df.write.format("delta").saveAsTable(...), you’re triggering two separate actions, and Spark will evaluate the DataFrame twice. That includes parsing the CSV and, importantly, processing bad records each time.

So you’re right to be cautious.

2)

Yes, writing to a table is a full action. It will force Spark to read, parse, and materialize all records in the DataFrame, and it will also trigger bad record handling. So this alone is sufficient to force the write to badRecordsPath there’s no need to call .write("noop") beforehand.

Best Regards,

Isi

View solution in original post