Skip to content

Commit 1685e4c

Browse files
authored
CDK changes for destination-databricks (#38095)
1 parent 82961ad commit 1685e4c

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

airbyte-cdk/java/airbyte-cdk/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ corresponds to that version.
173173
### Java CDK
174174

175175
| Version | Date | Pull Request | Subject |
176-
|:--------|:-----------| :--------------------------------------------------------- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------|
176+
|:--------|:-----------|:-----------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------|
177+
| 0.34.3 | 2024-05-10 | [\#38095](https://github.com/airbytehq/airbyte/pull/38095) | Minor changes for databricks connector |
177178
| 0.34.1 | 2024-05-07 | [\#38030](https://github.com/airbytehq/airbyte/pull/38030) | Add support for transient errors |
178179
| 0.34.0 | 2024-05-01 | [\#37712](https://github.com/airbytehq/airbyte/pull/37712) | Destinations: Remove incremental T+D |
179180
| 0.33.2 | 2024-05-03 | [\#37824](https://github.com/airbytehq/airbyte/pull/37824) | improve source acceptance tests |
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=0.34.2
1+
version=0.34.3

airbyte-cdk/java/airbyte-cdk/dependencies/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ dependencies {
1515
api 'com.fasterxml.jackson.core:jackson-databind'
1616
api 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
1717
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
18+
api 'com.fasterxml.jackson.module:jackson-module-kotlin'
1819
api 'com.google.guava:guava:33.0.0-jre'
1920
api 'commons-io:commons-io:2.15.1'
2021
api ('io.airbyte.airbyte-protocol:protocol-models:0.9.0') { exclude group: 'com.google.api-client', module: 'google-api-client' }

airbyte-cdk/java/airbyte-cdk/typing-deduping/src/testFixtures/kotlin/io/airbyte/integrations/base/destination/typing_deduping/BaseSqlGeneratorIntegrationTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ abstract class BaseSqlGeneratorIntegrationTest<DestinationState : MinimumDestina
15441544

15451545
@Test
15461546
@Throws(Exception::class)
1547-
fun testV1V2migration() {
1547+
open fun testV1V2migration() {
15481548
// This is maybe a little hacky, but it avoids having to refactor this entire class and
15491549
// subclasses
15501550
// for something that is going away

airbyte-cdk/java/airbyte-cdk/typing-deduping/src/testFixtures/kotlin/io/airbyte/integrations/base/destination/typing_deduping/RecordDiffer.kt

+11-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import com.google.common.collect.Streams
1010
import io.airbyte.commons.json.Jsons
1111
import java.math.BigDecimal
1212
import java.time.*
13+
import java.time.format.DateTimeParseException
1314
import java.util.*
1415
import java.util.function.Function
1516
import java.util.stream.Collectors
@@ -440,7 +441,16 @@ constructor(
440441
Instant.ofEpochMilli(Long.MIN_VALUE)
441442
} else {
442443
try {
443-
Instant.parse(node.asText())
444+
OffsetDateTime.parse(node.asText()).toInstant()
445+
} catch (parseE: DateTimeParseException) {
446+
// Fallback to using LocalDateTime and try again
447+
// Some databases have Timestamp_TZ mapped to TIMESTAMP with no offset,
448+
// this is sketchy to assume it as always UTC
449+
try {
450+
LocalDateTime.parse(node.asText()).toInstant(ZoneOffset.UTC)
451+
} catch (e: Exception) {
452+
Instant.ofEpochMilli(Long.MIN_VALUE)
453+
}
444454
} catch (e: Exception) {
445455
Instant.ofEpochMilli(Long.MIN_VALUE)
446456
}

0 commit comments

Comments
 (0)