diff --git a/airbyte-config/init/src/main/resources/seed/destination_definitions.yaml b/airbyte-config/init/src/main/resources/seed/destination_definitions.yaml index 7de7ab60f05f..ce094471e0d7 100644 --- a/airbyte-config/init/src/main/resources/seed/destination_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/destination_definitions.yaml @@ -355,7 +355,7 @@ - name: Snowflake destinationDefinitionId: 424892c4-daac-4491-b35d-c6688ba547ba dockerRepository: airbyte/destination-snowflake - dockerImageTag: 0.4.57 + dockerImageTag: 0.4.58 documentationUrl: https://docs.airbyte.com/integrations/destinations/snowflake icon: snowflake.svg normalizationConfig: diff --git a/airbyte-config/init/src/main/resources/seed/destination_specs.yaml b/airbyte-config/init/src/main/resources/seed/destination_specs.yaml index 1fba7cf9a59a..e1341903b9cf 100644 --- a/airbyte-config/init/src/main/resources/seed/destination_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/destination_specs.yaml @@ -6189,7 +6189,7 @@ supported_destination_sync_modes: - "overwrite" - "append" -- dockerImage: "airbyte/destination-snowflake:0.4.57" +- dockerImage: "airbyte/destination-snowflake:0.4.58" spec: documentationUrl: "https://docs.airbyte.com/integrations/destinations/snowflake" connectionSpecification: @@ -6213,6 +6213,9 @@ - "accountname.snowflakecomputing.com" type: "string" title: "Host" + pattern: "^(http(s)?:\\/\\/)?([^./?#]+\\.)?([^./?#]+\\.)?([^./?#]+\\.)?([^./?#]+\\\ + .snowflakecomputing\\.com)$" + pattern_descriptor: "{account_name}.snowflakecomputing.com or {accountname}.{aws_location}.aws.snowflakecomputing.com" order: 0 role: description: "Enter the urlsDataProvider() { + return Stream.of( + // See https://docs.snowflake.com/en/user-guide/admin-account-identifier for specific requirements + // "Account name in organization" style + arguments("https://acme-marketing-test-account.snowflakecomputing.com", true), + arguments("https://acme-marketing_test_account.snowflakecomputing.com", true), + arguments("https://acme-marketing.test-account.snowflakecomputing.com", true), + + // Legacy style (account locator in a region) + // Some examples taken from https://docs.snowflake.com/en/user-guide/admin-account-identifier#non-vps-account-locator-formats-by-cloud-platform-and-region + arguments("xy12345.snowflakecomputing.com", true), + arguments("xy12345.us-gov-west-1.aws.snowflakecomputing.com", true), + arguments("xy12345.us-east-1.aws.snowflakecomputing.com", true), + // And some other formats which are, de facto, valid + arguments("xy12345.foo.us-west-2.aws.snowflakecomputing.com", true), + arguments("https://xy12345.snowflakecomputing.com", true), + arguments("https://xy12345.us-east-1.snowflakecomputing.com", true), + arguments("https://xy12345.us-east-1.aws.snowflakecomputing.com", true), + arguments("https://xy12345.foo.us-west-2.aws.snowflakecomputing.com", true), + + // Invalid formats + arguments("example.snowflakecomputing.com/path/to/resource", false), + arguments("example.snowflakecomputing.com:8080", false), + arguments("example.snowflakecomputing.com:12345", false), + arguments("example.snowflakecomputing.com//path/to/resource", false), + arguments("example.snowflakecomputing.com/path?query=string", false), + arguments("example.snowflakecomputing.com/#fragment", false), + arguments("ab12345.us-east-2.aws.snowflakecomputing. com", false), + arguments("ab12345.us-east-2.aws.snowflakecomputing..com", false)); + } + + @ParameterizedTest + @MethodSource({"urlsDataProvider"}) + void testUrlPattern(final String url, final boolean isMatch) throws Exception { + final ConnectorSpecification spec = new SnowflakeDestination(OssCloudEnvVarConsts.AIRBYTE_OSS).spec(); + final Pattern pattern = Pattern.compile(spec.getConnectionSpecification().get("properties").get("host").get("pattern").asText()); + + Matcher matcher = pattern.matcher(url); + assertEquals(isMatch, matcher.find()); + } + @Test @DisplayName("When given S3 credentials should use COPY") public void useS3CopyStrategyTest() { diff --git a/connectors.md b/connectors.md index 6633bd992901..53d794eaa94c 100644 --- a/connectors.md +++ b/connectors.md @@ -333,7 +333,7 @@ | **S3 Glue** | S3 Glue icon | Destination | airbyte/destination-s3-glue:0.1.3 | alpha | [link](https://docs.airbyte.com/integrations/destinations/s3-glue) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/destination-s3-glue) | `471e5cab-8ed1-49f3-ba11-79c687784737` | | **SFTP-JSON** | SFTP-JSON icon | Destination | airbyte/destination-sftp-json:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/destinations/sftp-json) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/destination-sftp-json) | `e9810f61-4bab-46d2-bb22-edfc902e0644` | | **Scylla** | Scylla icon | Destination | airbyte/destination-scylla:0.1.3 | alpha | [link](https://docs.airbyte.com/integrations/destinations/scylla) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/destination-scylla) | `3dc6f384-cd6b-4be3-ad16-a41450899bf0` | -| **Snowflake** | Snowflake icon | Destination | airbyte/destination-snowflake:0.4.57 | generally_available | [link](https://docs.airbyte.com/integrations/destinations/snowflake) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/destination-snowflake) | `424892c4-daac-4491-b35d-c6688ba547ba` | +| **Snowflake** | Snowflake icon | Destination | airbyte/destination-snowflake:0.4.58 | generally_available | [link](https://docs.airbyte.com/integrations/destinations/snowflake) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/destination-snowflake) | `424892c4-daac-4491-b35d-c6688ba547ba` | | **Streamr** | Streamr icon | Destination | ghcr.io/devmate-cloud/streamr-airbyte-connectors:0.0.1 | alpha | [link](https://docs.airbyte.com/integrations/destinations/streamr) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/devmate-cloud) | `eebd85cf-60b2-4af6-9ba0-edeca01437b0` | | **Teradata Vantage** | Teradata Vantage icon | Destination | airbyte/destination-teradata:0.1.1 | alpha | [link](https://docs.airbyte.io/integrations/destinations/teradata) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/destination-teradata) | `58e6f9da-904e-11ed-a1eb-0242ac120002` | | **TiDB** | TiDB icon | Destination | airbyte/destination-tidb:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/destinations/tidb) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/destination-tidb) | `06ec60c7-7468-45c0-91ac-174f6e1a788b` | diff --git a/docs/integrations/destinations/snowflake.md b/docs/integrations/destinations/snowflake.md index f8a126f907a9..e35c28e7e604 100644 --- a/docs/integrations/destinations/snowflake.md +++ b/docs/integrations/destinations/snowflake.md @@ -275,7 +275,7 @@ Now that you have set up the Snowflake destination connector, check out the foll ## Troubleshooting ### 'Current role does not have permissions on the target schema' -If you receive an error stating `Current role does not have permissions on the target schema` make sure that the +If you receive an error stating `Current role does not have permissions on the target schema` make sure that the Snowflake destination `SCHEMA` is one that the role you've provided has permissions on. When creating a connection, it may allow you to select `Mirror source structure` for the `Destination namespace`, which if you have followed some of our default examples and tutorials may result in the connection trying to write to a `PUBLIC` schema. @@ -287,8 +287,8 @@ Otherwise, make sure to grant the role the required permissions in the desired n | Version | Date | Pull Request | Subject | |:--------|:-----------|:-----------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------| -| 0.4.57 | 2023-03-23 | [#23904](https://github.com/airbytehq/airbyte/pull/24405) | Revert host validation change | -| 0.4.56 | 2023-03-22 | [#23904](https://github.com/airbytehq/airbyte/pull/23904) | Added host validation by pattern on UI | +| 0.4.58 | 2023-03-27 | [#24615](https://github.com/airbytehq/airbyte/pull/24615) | Fixed host validation by pattern on UI | +| 0.4.56 (broken) | 2023-03-22 | [#23904](https://github.com/airbytehq/airbyte/pull/23904) | Added host validation by pattern on UI | | 0.4.54 | 2023-03-17 | [#23788](https://github.com/airbytehq/airbyte/pull/23788) | S3-Parquet: added handler to process null values in arrays | | 0.4.53 | 2023-03-15 | [\#24058](https://github.com/airbytehq/airbyte/pull/24058) | added write attempt to internal staging Check method | | 0.4.52 | 2023-03-10 | [\#23931](https://github.com/airbytehq/airbyte/pull/23931) | Added support for periodic buffer flush |