| 460 | } |
| 461 | |
| 462 | Status TableSinkBase::FinalizePartitionFileImpl(RuntimeState* state, |
| 463 | OutputPartition* partition, bool is_delete, DmlExecState* dml_exec_state) { |
| 464 | DCHECK(dml_exec_state != nullptr); |
| 465 | if (partition->tmp_hdfs_file == nullptr && !is_overwrite()) return Status::OK(); |
| 466 | SCOPED_TIMER(ADD_TIMER(profile(), "FinalizePartitionFileTimer")); |
| 467 | |
| 468 | // OutputPartition writer could be nullptr if there is no row to output. |
| 469 | if (partition->writer.get() != nullptr) { |
| 470 | RETURN_IF_ERROR(partition->writer->Finalize()); |
| 471 | dml_exec_state->UpdatePartition( |
| 472 | partition->partition_name, partition->current_file_rows, |
| 473 | &partition->writer->stats(), is_delete); |
| 474 | if (is_delete) { |
| 475 | DCHECK(IsIceberg()); |
| 476 | dml_exec_state->AddCreatedDeleteFile(*partition, |
| 477 | partition->writer->iceberg_file_stats()); |
| 478 | } else { |
| 479 | dml_exec_state->AddCreatedFile(*partition, IsIceberg(), |
| 480 | partition->writer->iceberg_file_stats()); |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | RETURN_IF_ERROR(ClosePartitionFile(state, partition)); |
| 485 | return Status::OK(); |
| 486 | } |
| 487 | |
| 488 | } |
| 489 |
nothing calls this directly
no test coverage detected