LuciferYang opened a new pull request, #10244: URL: https://github.com/apache/paimon/pull/10244
### Purpose The `SingleFileWriter` super constructor opens the data-file output stream and creates the file before the `RowDataFileWriter` body runs. A failure in the body, for example when `DataFileIndexWriter.create` rejects a malformed file-index option value that `CREATE TABLE` did not validate, previously escaped with no cleanup: the stream stayed open and an orphan data file was left behind, once per failed attempt, accumulating across retries and job restarts. This wraps the constructor body in a catch that aborts the auxiliary writers created so far and the main file, then rethrows. It also makes `abortExecutor` null-safe, because `super.abort` dispatches back to the overridden `abortExecutor` while the `auxiliaryFileWriters` field is still unassigned during construction-failure cleanup. This closes #10243. ### Tests Added `RowDataFileWriterTest.testConstructorFailureAbortsOpenedDataFile`. It supplies a non-numeric `file-index.bloom-filter.<col>.items` so `DataFileIndexWriter.create` throws after the super constructor has opened the data file, then asserts the format writer is closed once and the data file is deleted. Both assertions fail on the current code and pass with this change. ### API and Format No. ### Documentation No. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
