You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/TransactionalWrite.md
+15-6
Original file line number
Diff line number
Diff line change
@@ -103,12 +103,13 @@ writeFiles(
103
103
104
104
`writeFiles` is used when:
105
105
106
-
*`WriteIntoDelta` is requested to [write](commands/WriteIntoDelta.md#write)
106
+
*`WriteIntoDelta` is requested to [writeAndReturnCommitData](commands/WriteIntoDelta.md#writeAndReturnCommitData)
107
107
*`DeleteCommand` is requested to [rewriteFiles](commands/delete/DeleteCommand.md#rewriteFiles)
108
-
*`MergeIntoCommand` is requested to [writeInsertsOnlyWhenNoMatchedClauses](commands/merge/MergeIntoCommand.md#writeInsertsOnlyWhenNoMatchedClauses) and [writeAllChanges](commands/merge/MergeIntoCommand.md#writeAllChanges)
109
-
*`OptimizeExecutor` is requested to [runOptimizeBinJob](commands/optimize/OptimizeExecutor.md#runOptimizeBinJob)
108
+
*`MergeIntoCommandBase` is requested to [writeFiles](commands/merge/MergeIntoCommandBase.md#writeFiles)
110
109
*`UpdateCommand` is requested to [rewriteFiles](commands/update/UpdateCommand.md#rewriteFiles)
110
+
*`WriteIntoDelta` is requested to [writeAndReturnCommitData](commands/WriteIntoDelta.md#writeAndReturnCommitData), [writeFiles](commands/WriteIntoDelta.md#writeFiles)
111
111
*`DeltaSink` is requested to [add a streaming micro-batch](spark-connector/DeltaSink.md#addBatch)
112
+
*`OptimizeExecutor` is requested to [runOptimizeBinJob](commands/optimize/OptimizeExecutor.md#runOptimizeBinJob)
112
113
*`RemoveColumnMappingCommand` is requested to [write data out](commands/alter/RemoveColumnMappingCommand.md#writeData)
As the very last step within the scope of the [new execution ID](#writeFiles-deltaTransactionalWrite), `writeFiles`[writes out the data](DeltaFileFormatWriter.md#write).
218
219
@@ -223,9 +224,17 @@ As the very last step within the scope of the [new execution ID](#writeFiles-del
223
224
* No bucketing
224
225
*[DeltaJobStatisticsTracker](#writeFiles-optionalStatsTracker) and [BasicWriteJobStatsTracker](#writeFiles-statsTrackers)
225
226
226
-
### Step 7. AddFiles and AddCDCFiles { #writeFiles-FileActions }
227
+
### Step 7. Collect AddFiles and AddCDCFiles { #writeFiles-FileActions }
228
+
229
+
`writeFiles` requests the [DelayedCommitProtocol](#getCommitter) for the [AddFiles](DelayedCommitProtocol.md#addedStatuses).
230
+
231
+
With a [DeltaJobStatisticsTracker](#writeFiles-optionalStatsTracker), `writeFiles` adds the [recordedStats](DeltaJobStatisticsTracker.md#recordedStats) to every [AddFile](DelayedCommitProtocol.md#addedStatuses) (by [path](FileAction.md#toPath)).
232
+
233
+
With [Iceberg Compatibility V2 enabled](uniform/IcebergCompatV2.md#isEnabled), `writeFiles` adds `ICEBERG_COMPAT_VERSION` tag with the value of `2` to every [AddFile](DelayedCommitProtocol.md#addedStatuses).
234
+
235
+
With at least one [AddFile](DelayedCommitProtocol.md#addedStatuses) and the given `isOptimize` flag disabled, `writeFiles`[registers](OptimisticTransactionImpl.md#registerPostCommitHook) the [AutoCompact](auto-compaction/AutoCompact.md) post-commit hook.
227
236
228
-
In the end, `writeFiles` returns [AddFile](AddFile.md)s and [AddCDCFile](AddCDCFile.md)s (from the [DelayedCommitProtocol](#writeFiles-committer)).
237
+
In the end, `writeFiles` returns the [AddFile](AddFile.md)s and [AddCDCFile](AddCDCFile.md)s (from the [DelayedCommitProtocol](#writeFiles-committer)).
0 commit comments