@@ -274,7 +274,7 @@ TEST_F(RowDeltaTest, ValidateNoConflictingDeleteFilesFailsForConcurrentDelete) {
274274 EXPECT_THAT (result, HasErrorMessage (delete_file->file_path ));
275275}
276276
277- TEST_F (RowDeltaTest, ValidateDataFilesExistFailsForConcurrentDelete ) {
277+ TEST_F (RowDeltaTest, ValidateDataFilesExistSkipsConcurrentDeleteByDefault ) {
278278 CommitFileA ();
279279 ICEBERG_UNWRAP_OR_FAIL (auto starting_snapshot, table_->current_snapshot ());
280280
@@ -294,6 +294,30 @@ TEST_F(RowDeltaTest, ValidateDataFilesExistFailsForConcurrentDelete) {
294294 row_delta->ValidateDataFilesExist (referenced_files);
295295 row_delta->AddDeletes (delete_file);
296296
297+ EXPECT_THAT (row_delta->Commit (), IsOk ());
298+ }
299+
300+ TEST_F (RowDeltaTest, ValidateDataFilesExistFailsForConcurrentDeleteWithValidateDeletedFiles) {
301+ CommitFileA ();
302+ ICEBERG_UNWRAP_OR_FAIL (auto starting_snapshot, table_->current_snapshot ());
303+
304+ ICEBERG_UNWRAP_OR_FAIL (auto delete_files, table_->NewDeleteFiles ());
305+ delete_files->DeleteFile (file_a_);
306+ EXPECT_THAT (delete_files->Commit (), IsOk ());
307+ EXPECT_THAT (table_->Refresh (), IsOk ());
308+
309+ auto delete_file = MakeDeleteFile (" /delete/file_a_pos_deletes.parquet" ,
310+ /* partition_x=*/ 1L );
311+ delete_file->referenced_data_file = file_a_->file_path ;
312+
313+ std::shared_ptr<RowDelta> row_delta;
314+ ICEBERG_UNWRAP_OR_FAIL (row_delta, table_->NewRowDelta ());
315+ row_delta->ValidateFromSnapshot (starting_snapshot->snapshot_id );
316+ std::vector<std::string> referenced_files{file_a_->file_path };
317+ row_delta->ValidateDataFilesExist (referenced_files);
318+ row_delta->ValidateDeletedFiles ();
319+ row_delta->AddDeletes (delete_file);
320+
297321 auto result = row_delta->Commit ();
298322 EXPECT_THAT (result, IsError (ErrorKind::kValidationFailed ));
299323 EXPECT_THAT (result, HasErrorMessage (" Cannot commit, missing data files" ));
0 commit comments