Skip to content

Commit 24b7649

Browse files
committed
close also closes
1 parent 491ed6d commit 24b7649

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

airbyte-cdk/bulk/core/load/src/main/kotlin/io/airbyte/cdk/load/write/DirectLoader.kt

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ import io.airbyte.cdk.load.message.DestinationRecordRaw
3232
* always forward whatever work is in progress in [finish], as [accept] will not be called again for
3333
* the same batch.
3434
*
35+
* After [accept] returns a [DirectLoader.Complete] status, or after [finish] returns, the
36+
* DirectLoader MUST have committed all data durably to the destination.
37+
*
3538
* [close] will be called once at the end of the batch, after the last call to [accept] or [finish],
3639
* or if the sync fails. Afterward the loader will be discarded and a new one will be created for
3740
* the next batch if more data arrives. (Note: close should only be used to do cleanup that must

airbyte-integrations/connectors/destination-bigquery/src/main/kotlin/io/airbyte/integrations/destination/bigquery/write/standard_insert/BigqueryBatchStandardInsertLoader.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ class BigqueryBatchStandardInsertsLoader(
5151
}
5252

5353
override fun close() {
54-
// do nothing
54+
if (writer.isOpen) {
55+
writer.close()
56+
}
5557
}
5658
}
5759

0 commit comments

Comments
 (0)