Details
-
Bug
-
Status: In Progress
-
Minor
-
Resolution: Unresolved
-
3.3.1
-
None
Description
There is a difference in behavior between v1 writes and v2 writes in the order of events happening when configuring the file writer and the committer.
v1:
- writer.prepareWrite()
- committer.setupJob()
v2:
- committer.setupJob()
- writer.prepareWrite()
This is because the `prepareWrite()` call (that is the one performing the call `
job.setOutputFormatClass(classOf[ParquetOutputFormat[Row]])`)
happens as part of the `createWriteJobDescription` which is `lazy val` in the `toBatch` call and therefore is evaluated after the `committer.setupJob` at the end of the `toBatch`
This causes issues when evaluating the committer as some elements might be missing, for example the aforementioned output format class not being set, causing the committer being set up as generic write instead of parquet write.
The fix is very simple and it is to make the `createJobDescription` call non-lazy