Repository navigation
Destination Snowflake: set jdbc application env variable depends on env - airbyte_oss or airbyte_cloud - #19302
Conversation
…nds on env - airbyte_oss or airbyte_cloud
Affected Connector ReportNOTE
|
| Connector | Version | Changelog | Publish |
|---|
- See "Actionable Items" below for how to resolve warnings and errors.
✅ Destinations (1)
| Connector | Version | Changelog | Publish |
|---|---|---|---|
destination-snowflake |
0.4.40 |
✅ | ✅ |
- See "Actionable Items" below for how to resolve warnings and errors.
Actionable Items
(click to expand)
| Category | Status | Actionable Item |
|---|---|---|
| Version | ❌ mismatch |
The version of the connector is different from its normal variant. Please bump the version of the connector. |
| ⚠ doc not found |
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug. |
|
| Changelog | ⚠ doc not found |
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug. |
| ❌ changelog missing |
There is no chnagelog for the current version of the connector. If you are the author of the current version, please add a changelog. | |
| Publish | ⚠ not in seed |
The connector is not in the seed file (e.g. source_definitions.yaml), so its publication status cannot be checked. This can be normal (e.g. some connectors are cloud-specific, and only listed in the cloud seed file). Please double-check to make sure that it is not a bug. |
| ❌ diff seed version |
The connector exists in the seed file, but the latest version is not listed there. This usually means that the latest version is not published. Please use the /publish command to publish the latest version. |
|
Hi Edward Gao (@edgao). |
Edward Gao (edgao)
left a comment
There was a problem hiding this comment.
nice! yeah this is exactly what I was thinking. LMK when it's ready for final review - I added a few initial comments but this looks good so far 👍
| @@ -0,0 +1,8 @@ | |||
| package io.airbyte.integrations.util; | |||
|
|
|||
| public class OssCloudEnvVarConsts { | |||
There was a problem hiding this comment.
let's actually define these in destination-snowflake, since they're specifically what Snowflake is looking for
There was a problem hiding this comment.
Moved to Destination Snowflake connector. Thanks
| SnowflakeDestinationResolver.getTypeToDestination(airbyteEnvironment)); | ||
| } | ||
|
|
||
| public static void main(final String[] args) throws Exception { |
There was a problem hiding this comment.
probably best to just delete this method entirely, to avoid confusion?
There was a problem hiding this comment.
Yup, now it shouldn't be used anymore. Removed
| @Override | ||
| protected DataSource getDataSource(final JsonNode config) { | ||
| return SnowflakeDatabase.createDataSource(config); | ||
| return SnowflakeDatabase.createDataSource(config, OssCloudEnvVarConsts.AIRBYTE_OSS); |
There was a problem hiding this comment.
is this class even still in use? I.e. can we just delete this file completely
There was a problem hiding this comment.
Nice catch. I haven't checked carefully yet, it was automatically updated by refactor IntelliIdea's feature. At first glance it's not used at all. Removed for now, will check later if it cause any issues
| AdaptiveDestinationRunner.baseOnEnv() | ||
| .withOssDestination(() -> new SnowflakeDestination(OssCloudEnvVarConsts.AIRBYTE_OSS)) | ||
| .withCloudDestination(() -> new SnowflakeDestination(OssCloudEnvVarConsts.AIRBYTE_CLOUD)) | ||
| .run(args); |
There was a problem hiding this comment.
this probably also needs to do a SCHEDULED_EXECUTOR_SERVICE.shutdownNow(); similar to Akash's PR https://github.com/airbytehq/airbyte/pull/19314/files#diff-d6c8766f9065e3ddfc335cd448642c552b312f2d1feac08e62793aec3716df12R16
There was a problem hiding this comment.
updated, thanks!
| @@ -0,0 +1,16 @@ | |||
| package io.airbyte.integrations.destination.snowflake; | |||
There was a problem hiding this comment.
Missing
/*
* Copyright (c) 2022 Airbyte, Inc., all rights reserved.
*/There was a problem hiding this comment.
Added, thanks
|
/test connector=connectors/destination-snowflake
Build PassedTest summary info: |
|
/publish connector=connectors/destination-snowflake
if you have connectors that successfully published but failed definition generation, follow step 4 here |
| final SnowflakeInternalStagingDestination internalStagingDestination = new SnowflakeInternalStagingDestination(); | ||
| final SnowflakeCopyAzureBlobStorageDestination azureBlobStorageDestination = new SnowflakeCopyAzureBlobStorageDestination(); | ||
| public static Map<DestinationType, Destination> getTypeToDestination( | ||
| final String airbyteEnvironment) { |
There was a problem hiding this comment.
this should be on the same line as above, right?
There was a problem hiding this comment.
For some reason, it started looking line that after "gradlew format" command (this command is also run in CI). I tried to make it a single line manually twice, but the automatic format sets it as you see now. Have no idea why
There was a problem hiding this comment.
In that case, we can keep this change and it appears you're already in the publication process plus it's not a functional requirement. Thanks for the context though
| * Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
| */ | ||
|
|
||
| package io.airbyte.integrations.destination.snowflake; |
There was a problem hiding this comment.
For context, through code inspect this class doesn't appear to be in use so removal makes sense
|
|
||
| public static void main(final String[] args) throws Exception { | ||
| AdaptiveDestinationRunner.baseOnEnv() | ||
| .withOssDestination(() -> new SnowflakeDestination(OssCloudEnvVarConsts.AIRBYTE_OSS)) |
There was a problem hiding this comment.
not blocking, maybe could have these variables imported at the top to keep in sync with Snowflake Source
There was a problem hiding this comment.
In one of the comments above, I was asked to downgrade it from Base level to destination one :) I already published the connector but will have a look at my next PR. At the moment when I started working on this PR we didn't have these vars. Thanks
Ryan Fu (ryankfu)
left a comment
There was a problem hiding this comment.
LGTM, minor comments but nothing blocking. Thanks for taking this on
…nv - airbyte_oss or airbyte_cloud (#19302) * [19250] Destination Snowflake: set jdbc application env variable depends on env - airbyte_oss or airbyte_cloud
What
Snowflake destination should set application ID in JDBC param depending on env - oss or cloud.
How
Updated connector to set it dynamically
Recommended reading order
🚨 User Impact 🚨
No breaking changes expected
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret./gradlew :airbyte-integrations:connectors:<name>:integrationTest.README.mdbootstrap.md. See description and examplesdocs/integrations/<source or destination>/<name>.mdincluding changelog. See changelog exampledocs/integrations/README.mdairbyte-integrations/builds.mdAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>command is passing/publishcommand described hereUpdating a connector
Community member or Airbyter
airbyte_secret./gradlew :airbyte-integrations:connectors:<name>:integrationTest.README.mdbootstrap.md. See description and examplesdocs/integrations/<source or destination>/<name>.mdincluding changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>command is passing/publishcommand described hereConnector Generator
-scaffoldin their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplatesthen checking in your changesTests
Unit
Put your unit tests output here.
Integration
Put your integration tests output here.
Acceptance
Put your acceptance tests output here.