-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Destination Snowflake: set jdbc application env variable depends on env - airbyte_oss or airbyte_cloud #19302
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 @edgao. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's actually define these in destination-snowflake, since they're specifically what Snowflake is looking for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to Destination Snowflake connector. Thanks
super(DestinationType.class, SnowflakeDestinationResolver::getTypeFromConfig, SnowflakeDestinationResolver.getTypeToDestination()); | ||
public SnowflakeDestination(final String airbyteEnvironment) { | ||
super(DestinationType.class, SnowflakeDestinationResolver::getTypeFromConfig, | ||
SnowflakeDestinationResolver.getTypeToDestination(airbyteEnvironment)); | ||
} | ||
|
||
public static void main(final String[] args) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably best to just delete this method entirely, to avoid confusion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, now it shouldn't be used anymore. Removed
@@ -26,7 +27,7 @@ public SnowflakeInsertDestination() { | |||
|
|||
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this class even still in use? I.e. can we just delete this file completely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AdaptiveDestinationRunner.baseOnEnv() | ||
.withOssDestination(() -> new SnowflakeDestination(OssCloudEnvVarConsts.AIRBYTE_OSS)) | ||
.withCloudDestination(() -> new SnowflakeDestination(OssCloudEnvVarConsts.AIRBYTE_CLOUD)) | ||
.run(args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated, thanks!
@@ -0,0 +1,16 @@ | |||
package io.airbyte.integrations.destination.snowflake; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing
/*
* Copyright (c) 2022 Airbyte, Inc., all rights reserved.
*/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be on the same line as above, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not blocking, maybe could have these variables imported at the top to keep in sync with Snowflake Source
Lines 7 to 8 in 75d1353
import static io.airbyte.integrations.source.snowflake.SnowflakeDataSourceUtils.AIRBYTE_CLOUD; | |
import static io.airbyte.integrations.source.snowflake.SnowflakeDataSourceUtils.AIRBYTE_OSS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
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/publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including 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/publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then 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.