File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -553,7 +553,8 @@ def merge_from_stage(
553
553
key_properties = key_properties ,
554
554
)
555
555
self .logger .debug ("Merging with SQL: %s" , merge_statement )
556
- conn .execute (merge_statement , ** kwargs )
556
+ result = conn .execute (merge_statement , ** kwargs )
557
+ return result .rowcount
557
558
558
559
def copy_from_stage (
559
560
self ,
@@ -578,7 +579,8 @@ def copy_from_stage(
578
579
file_format = file_format ,
579
580
)
580
581
self .logger .debug ("Copying with SQL: %s" , copy_statement )
581
- conn .execute (copy_statement , ** kwargs )
582
+ result = conn .execute (copy_statement , ** kwargs )
583
+ return result .rowcount
582
584
583
585
def drop_file_format (self , file_format : str ) -> None :
584
586
"""Drop a file format in the schema.
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ def insert_batch_files_via_internal_stage(
190
190
191
191
if self .key_properties :
192
192
# merge into destination table
193
- self .connector .merge_from_stage (
193
+ record_count = self .connector .merge_from_stage (
194
194
full_table_name = full_table_name ,
195
195
schema = self .schema ,
196
196
sync_id = sync_id ,
@@ -199,13 +199,16 @@ def insert_batch_files_via_internal_stage(
199
199
)
200
200
201
201
else :
202
- self .connector .copy_from_stage (
202
+ record_count = self .connector .copy_from_stage (
203
203
full_table_name = full_table_name ,
204
204
schema = self .schema ,
205
205
sync_id = sync_id ,
206
206
file_format = file_format ,
207
207
)
208
208
209
+ with self .record_counter_metric as counter :
210
+ counter .increment (record_count )
211
+
209
212
finally :
210
213
self .logger .debug ("Cleaning up after batch processing" )
211
214
self .connector .drop_file_format (file_format = file_format )
You can’t perform that action at this time.
0 commit comments