Skip to content

Commit

Permalink
destination-snowflake: adopt cleaned-up cdk (airbytehq#34747)
Browse files Browse the repository at this point in the history
  • Loading branch information
postamar authored and jatinyadav-cc committed Feb 26, 2024
1 parent abc3f7f commit 8ed3374
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
plugins {
id 'application'
id 'airbyte-java-connector'
}

airbyteJavaConnector {
cdkVersionRequired = '0.17.1'
cdkVersionRequired = '0.19.0'
features = ['db-destinations', 's3-destinations', 'typing-deduping']
useLocalCdk = false
}

airbyteJavaConnector.addCdkDependencies()

application {
mainClass = 'io.airbyte.integrations.destination.snowflake.SnowflakeDestinationRunner'
// enable when profiling
Expand Down Expand Up @@ -39,13 +36,5 @@ integrationTestJava {

dependencies {
implementation 'net.snowflake:snowflake-jdbc:3.14.1'
implementation 'org.apache.commons:commons-csv:1.4'
implementation 'org.apache.commons:commons-text:1.10.0'
implementation "io.aesy:datasize:1.0.0"
implementation 'com.zaxxer:HikariCP:5.0.1'

// this is a configuration to make mockito work with final classes
testImplementation 'org.mockito:mockito-inline:2.13.0'

integrationTestJavaImplementation 'org.apache.commons:commons-lang3:3.11'
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ data:
connectorSubtype: database
connectorType: destination
definitionId: 424892c4-daac-4491-b35d-c6688ba547ba
dockerImageTag: 3.5.6
dockerImageTag: 3.5.7
dockerRepository: airbyte/destination-snowflake
documentationUrl: https://docs.airbyte.com/integrations/destinations/snowflake
githubIssueLabel: destination-snowflake
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
import io.airbyte.commons.string.Strings;
import java.io.IOException;
import java.sql.SQLException;
import java.time.Instant;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.stream.Stream;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -62,13 +64,14 @@ public String getStagingPath(final UUID connectionId,
final String namespace,
final String streamName,
final String outputTableName,
final DateTime writeDatetime) {
final Instant writeDatetime) {
// see https://docs.snowflake.com/en/user-guide/data-load-considerations-stage.html
final var zonedDateTime = ZonedDateTime.ofInstant(writeDatetime, ZoneOffset.UTC);
return nameTransformer.applyDefaultCase(String.format("%s/%02d/%02d/%02d/%s/",
writeDatetime.year().get(),
writeDatetime.monthOfYear().get(),
writeDatetime.dayOfMonth().get(),
writeDatetime.hourOfDay().get(),
zonedDateTime.getYear(),
zonedDateTime.getMonthValue(),
zonedDateTime.getDayOfMonth(),
zonedDateTime.getHour(),
connectionId));
}

Expand Down
1 change: 1 addition & 0 deletions docs/integrations/destinations/snowflake.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ Otherwise, make sure to grant the role the required permissions in the desired n

| Version | Date | Pull Request | Subject |
|:----------------|:-----------|:-----------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 3.5.7 | 2024-02-08 | [34747](https://github.com/airbytehq/airbyte/pull/34747) | Adopt CDK 0.19.0 |
| 3.5.6 | 2024-02-08 | [\#35027](https://github.com/airbytehq/airbyte/pull/35027) | Upgrade CDK to version 0.17.1 |
| 3.5.5 | 2024-02-08 | [\#34502](https://github.com/airbytehq/airbyte/pull/34502) | Reduce COPY frequency |
| 3.5.4 | 2024-01-24 | [\#34451](https://github.com/airbytehq/airbyte/pull/34451) | Improve logging for unparseable input |
Expand Down

0 comments on commit 8ed3374

Please sign in to comment.