-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Describe the bug, including details regarding any error messages, version, and platform.
ParquetProperties.valuesWriterFactory defaults to a singleton instance of DefaultValuesWriterFactory.
ParquetOutputFormat.getRecordWriter provides no way of setting/overriding "valuesWriterFactory" in ParquetProperties.Builder so the same singleton instance of DefaultValuesWriterFactory is used every time.
DefaultValuesWriterFactory.initialize dynamically sets the instance field "delegateFactory" to either a v1 or v2 factory.
When writing to multiple parquet files concurrently, with some threads using v1 and others using v2, the actual writer used becomes unpredictable and files get written with an incorrect format.
Potential fix: ParquetProperties.Builder.valuesWriterFactory should not be instantiated to a singleton instance of DefaultValuesWriterFactory. Instead, it should be instantiated to a new instance of DefaultValuesWriterFactory in the constructor of ParquetProperties.Builder
Component(s)
No response