File tree 3 files changed +60
-50
lines changed
airbyte-integrations/connectors/destination-bigquery/src/main/kotlin/io/airbyte/integrations/destination/bigquery
3 files changed +60
-50
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2025 Airbyte, Inc., all rights reserved.
3
+ */
4
+
5
+ package io.airbyte.integrations.destination.bigquery
6
+
7
+ import io.airbyte.cdk.load.check.DestinationCheckerSync
8
+ import io.airbyte.cdk.load.command.DestinationCatalog
9
+ import io.airbyte.cdk.load.state.SyncManager
10
+ import io.airbyte.cdk.load.task.DestinationTaskLauncher
11
+ import io.airbyte.cdk.load.write.WriteOperation
12
+ import io.airbyte.integrations.destination.bigquery.check.BigqueryCheckCleaner
13
+ import io.micronaut.context.annotation.Factory
14
+ import jakarta.inject.Named
15
+ import jakarta.inject.Singleton
16
+ import java.io.PipedOutputStream
17
+
18
+ @Factory
19
+ class BigqueryBeansFactory {
20
+ @Singleton
21
+ fun getChecker (
22
+ catalog : DestinationCatalog ,
23
+ @Named(" checkInputStreamPipe" ) pipe : PipedOutputStream ,
24
+ taskLauncher : DestinationTaskLauncher ,
25
+ syncManager : SyncManager ,
26
+ ) =
27
+ DestinationCheckerSync (
28
+ catalog,
29
+ pipe,
30
+ WriteOperation (taskLauncher, syncManager),
31
+ BigqueryCheckCleaner (),
32
+ )
33
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2025 Airbyte, Inc., all rights reserved.
3
+ */
4
+
5
+ package io.airbyte.integrations.destination.bigquery.check
6
+
7
+ import io.airbyte.cdk.load.check.CheckCleaner
8
+ import io.airbyte.cdk.load.command.DestinationStream
9
+ import io.airbyte.integrations.destination.bigquery.spec.BigqueryConfiguration
10
+ import io.airbyte.integrations.destination.bigquery.typing_deduping.BigqueryFinalTableNameGenerator
11
+ import io.airbyte.integrations.destination.bigquery.typing_deduping.BigqueryRawTableNameGenerator
12
+ import io.airbyte.integrations.destination.bigquery.typing_deduping.toTableId
13
+ import io.airbyte.integrations.destination.bigquery.util.BigqueryClientFactory
14
+
15
+ class BigqueryCheckCleaner : CheckCleaner <BigqueryConfiguration > {
16
+ override fun cleanup (config : BigqueryConfiguration , stream : DestinationStream ) {
17
+ val bq = BigqueryClientFactory (config).make()
18
+ bq.getTable(
19
+ BigqueryRawTableNameGenerator (config).getTableName(stream.descriptor).toTableId()
20
+ )
21
+ ?.delete()
22
+ bq.getTable(
23
+ BigqueryFinalTableNameGenerator (config).getTableName(stream.descriptor).toTableId()
24
+ )
25
+ ?.delete()
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments