@@ -122,14 +122,13 @@ public actor MergeIntoWriter {
122122
123123 var mergeIntoTableCommand = MergeIntoTableCommand ( )
124124
125- init ( _ table: String , _ df: DataFrame , _ condition: String ) async {
125+ init ( _ table: String , _ df: DataFrame , _ condition: String ) {
126126 self . table = table
127127 self . df = df
128128 self . condition = condition
129129
130- mergeIntoTableCommand. targetTableName = table
131- mergeIntoTableCommand. sourceTablePlan = await ( df. getPlan ( ) as! Plan ) . root
132- mergeIntoTableCommand. mergeCondition. expressionString = condition. toExpressionString
130+ self . mergeIntoTableCommand. targetTableName = table
131+ self . mergeIntoTableCommand. mergeCondition. expressionString = condition. toExpressionString
133132 }
134133
135134 public var schemaEvolutionEnabled : Bool {
@@ -150,7 +149,7 @@ public actor MergeIntoWriter {
150149 }
151150
152151 /// Initialize a `WhenMatched` action with a condition.
153- /// - Parameter condition: <# condition description#>
152+ /// - Parameter condition: The condition to be evaluated for the action.
154153 /// - Returns: A `WhenMatched` instance configured with the specified condition.
155154 public func whenMatched( _ condition: String ) -> WhenMatched {
156155 WhenMatched ( self , condition)
@@ -190,6 +189,7 @@ public actor MergeIntoWriter {
190189 {
191190 throw SparkConnectError . InvalidArgumentException
192191 }
192+ self . mergeIntoTableCommand. sourceTablePlan = await ( self . df. getPlan ( ) as! Plan ) . root
193193 self . mergeIntoTableCommand. withSchemaEvolution = self . schemaEvolution
194194
195195 var command = Spark_Connect_Command ( )
0 commit comments