Skip to content

Commit 251343f

Browse files
edgaokabeer27
authored andcommitted
Destination bigquery: Bump cdk again (airbytehq#38331)
1 parent 5203893 commit 251343f

File tree

6 files changed

+14
-24
lines changed

6 files changed

+14
-24
lines changed

airbyte-integrations/connectors/destination-bigquery/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
}
44

55
airbyteJavaConnector {
6-
cdkVersionRequired = '0.36.8'
6+
cdkVersionRequired = '0.37.1'
77
features = [
88
'db-destinations',
99
'datastore-bigquery',

airbyte-integrations/connectors/destination-bigquery/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ data:
55
connectorSubtype: database
66
connectorType: destination
77
definitionId: 22f6c74f-5699-40ff-833c-4a879ea40133
8-
dockerImageTag: 2.6.2
8+
dockerImageTag: 2.6.3
99
dockerRepository: airbyte/destination-bigquery
1010
documentationUrl: https://docs.airbyte.com/integrations/destinations/bigquery
1111
githubIssueLabel: destination-bigquery

airbyte-integrations/connectors/destination-bigquery/src/main/kotlin/io/airbyte/integrations/destination/bigquery/BigQueryConsumerFactory.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ object BigQueryConsumerFactory {
3333
catalog = catalog,
3434
bufferManager =
3535
BufferManager(
36+
defaultNamespace,
3637
(Runtime.getRuntime().maxMemory() * 0.4).toLong(),
3738
),
38-
defaultNamespace = Optional.of(defaultNamespace),
3939
)
4040
}
4141

@@ -59,9 +59,9 @@ object BigQueryConsumerFactory {
5959
catalog = catalog,
6060
bufferManager =
6161
BufferManager(
62+
defaultNamespace,
6263
(Runtime.getRuntime().maxMemory() * 0.5).toLong(),
6364
),
64-
defaultNamespace = Optional.of(defaultNamespace),
6565
)
6666
}
6767
}

airbyte-integrations/connectors/destination-bigquery/src/main/kotlin/io/airbyte/integrations/destination/bigquery/BigQueryDestination.kt

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ import java.io.ByteArrayInputStream
5656
import java.io.IOException
5757
import java.util.*
5858
import java.util.function.Consumer
59-
import org.apache.commons.lang3.StringUtils
6059

6160
private val log = KotlinLogging.logger {}
6261

@@ -188,7 +187,6 @@ class BigQueryDestination : BaseConnector(), Destination {
188187
): SerializedAirbyteMessageConsumer {
189188
val uploadingMethod = getLoadingMethod(config)
190189
val defaultNamespace = getDatasetId(config)
191-
setDefaultStreamNamespace(catalog, defaultNamespace)
192190
val disableTypeDedupe = getDisableTypeDedupFlag(config)
193191
val datasetLocation = getDatasetLocation(config)
194192
val projectId = config[bqConstants.CONFIG_PROJECT_ID].asText()
@@ -220,6 +218,7 @@ class BigQueryDestination : BaseConnector(), Destination {
220218
val parsedCatalog =
221219
parseCatalog(
222220
sqlGenerator,
221+
defaultNamespace,
223222
rawNamespaceOverride.orElse(JavaBaseConstants.DEFAULT_AIRBYTE_INTERNAL_NAMESPACE),
224223
catalog,
225224
)
@@ -307,28 +306,18 @@ class BigQueryDestination : BaseConnector(), Destination {
307306
)
308307
}
309308

310-
private fun setDefaultStreamNamespace(catalog: ConfiguredAirbyteCatalog, namespace: String) {
311-
// Set the default originalNamespace on streams with null originalNamespace. This means we
312-
// don't
313-
// need to repeat this
314-
// logic in the rest of the connector.
315-
// (record messages still need to handle null namespaces though, which currently happens in
316-
// e.g.
317-
// AsyncStreamConsumer#accept)
318-
// This probably should be shared logic amongst destinations eventually.
319-
for (stream in catalog.streams) {
320-
if (StringUtils.isEmpty(stream.stream.namespace)) {
321-
stream.stream.withNamespace(namespace)
322-
}
323-
}
324-
}
325-
326309
private fun parseCatalog(
327310
sqlGenerator: BigQuerySqlGenerator,
311+
defaultNamespace: String,
328312
rawNamespaceOverride: String,
329313
catalog: ConfiguredAirbyteCatalog
330314
): ParsedCatalog {
331-
val catalogParser = CatalogParser(sqlGenerator, rawNamespaceOverride)
315+
val catalogParser =
316+
CatalogParser(
317+
sqlGenerator,
318+
defaultNamespace = defaultNamespace,
319+
rawNamespace = rawNamespaceOverride,
320+
)
332321

333322
return catalogParser.parseCatalog(catalog)
334323
}

airbyte-integrations/connectors/destination-bigquery/src/test/java/io/airbyte/integrations/destination/bigquery/typing_deduping/BigQuerySqlGeneratorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void testBuildColumnId() {
3535

3636
@Test
3737
void columnCollision() {
38-
final CatalogParser parser = new CatalogParser(generator);
38+
final CatalogParser parser = new CatalogParser(generator, "default_ns");
3939
assertEquals(
4040
new StreamConfig(
4141
new StreamId("bar", "foo", "airbyte_internal", "bar_raw__stream_foo", "bar", "foo"),

docs/integrations/destinations/bigquery.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ tutorials:
223223

224224
| Version | Date | Pull Request | Subject |
225225
|:--------|:-----------|:-----------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------|
226+
| 2.6.3 | 2024-05-30 | [38331](https://github.com/airbytehq/airbyte/pull/38331) | Internal code changes in preparation for future feature release |
226227
| 2.6.2 | 2024-06-07 | [38764](https://github.com/airbytehq/airbyte/pull/38764) | Increase message length limit to 50MiB |
227228
| 2.6.1 | 2024-05-29 | [38770](https://github.com/airbytehq/airbyte/pull/38770) | Internal code change (switch to CDK artifact) |
228229
| 2.6.0 | 2024-05-28 | [38359](https://github.com/airbytehq/airbyte/pull/38359) | Propagate airbyte_meta from sources; add generation_id column |

0 commit comments

Comments
 (0)