| 173 | } |
| 174 | |
| 175 | bool DmlExecState::PrepareCatalogUpdate(TUpdateCatalogRequest* catalog_update, |
| 176 | const TFinalizeParams& finalize_params) { |
| 177 | lock_guard<mutex> l(lock_); |
| 178 | for (const PartitionStatusMap::value_type& partition : per_partition_status_) { |
| 179 | TUpdatedPartition updatedPartition; |
| 180 | for (int i = 0; i < partition.second.created_files_size(); ++i) { |
| 181 | const DmlFileStatusPb& file = partition.second.created_files(i); |
| 182 | updatedPartition.files.push_back(file.final_path()); |
| 183 | } |
| 184 | for (int i = 0; i < partition.second.created_delete_files_size(); ++i) { |
| 185 | const DmlFileStatusPb& file = partition.second.created_delete_files(i); |
| 186 | updatedPartition.files.push_back(file.final_path()); |
| 187 | } |
| 188 | catalog_update->updated_partitions[partition.first] = updatedPartition; |
| 189 | } |
| 190 | if (finalize_params.__isset.iceberg_params |
| 191 | && finalize_params.iceberg_params.operation == TIcebergOperation::OPTIMIZE) { |
| 192 | return true; |
| 193 | } |
| 194 | return catalog_update->updated_partitions.size() != 0; |
| 195 | } |
| 196 | |
| 197 | // Deletes data files and directories in 'path'. Keeps top-level |
| 198 | // - hidden files |
no test coverage detected