Skip to content

Commit 334bf5e

Browse files
committed
Add comments
1 parent b5dcc6e commit 334bf5e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Sources/SparkConnect/MergeIntoWriter.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ public struct WhenNotMatched: Sendable {
7575
}
7676
}
7777

78+
/// A struct for defining actions to be performed when there is no match by source during a merge
79+
/// operation in a ``MergeIntoWriter``.
7880
public struct WhenNotMatchedBySource: Sendable {
7981
let mergeIntoWriter: MergeIntoWriter
8082
let condition: String?
@@ -84,14 +86,24 @@ public struct WhenNotMatchedBySource: Sendable {
8486
self.condition = condition
8587
}
8688

89+
/// Specifies an action to update all non-matched rows in the target ``DataFrame``
90+
/// when not matched by the source.
91+
/// - Returns: A ``MergeIntoWriter`` instance.
8792
public func updateAll() async -> MergeIntoWriter {
8893
await mergeIntoWriter.updateAll(condition, true)
8994
}
9095

96+
/// Specifies an action to update non-matched rows in the target ``DataFrame``
97+
/// with the provided column assignments when not matched by the source.
98+
/// - Parameter map: A dictionary from column names to expressions representing the updates to be applied
99+
/// - Returns: A ``MergeIntoWriter`` instance.
91100
public func update(map: [String: String]) async -> MergeIntoWriter {
92101
await mergeIntoWriter.update(condition, map, true)
93102
}
94103

104+
/// Specifies an action to delete non-matched rows from the target ``DataFrame``
105+
/// when not matched by the source.
106+
/// - Returns: A ``MergeIntoWriter`` instance.
95107
public func delete() async -> MergeIntoWriter {
96108
await mergeIntoWriter.delete(condition, true)
97109
}

0 commit comments

Comments
 (0)