diff --git a/airbyte-config/init/src/main/resources/config/STANDARD_DESTINATION_DEFINITION/8ccd8909-4e99-4141-b48d-4984b70b2d89.json b/airbyte-config/init/src/main/resources/config/STANDARD_DESTINATION_DEFINITION/8ccd8909-4e99-4141-b48d-4984b70b2d89.json index 67f4c1be3b7d..574718d34ab7 100644 --- a/airbyte-config/init/src/main/resources/config/STANDARD_DESTINATION_DEFINITION/8ccd8909-4e99-4141-b48d-4984b70b2d89.json +++ b/airbyte-config/init/src/main/resources/config/STANDARD_DESTINATION_DEFINITION/8ccd8909-4e99-4141-b48d-4984b70b2d89.json @@ -2,7 +2,7 @@ "destinationDefinitionId": "8ccd8909-4e99-4141-b48d-4984b70b2d89", "name": "DynamoDB", "dockerRepository": "airbyte/destination-dynamodb", - "dockerImageTag": "0.1.0", + "dockerImageTag": "0.1.1", "documentationUrl": "https://docs.airbyte.io/integrations/destinations/dynamodb", "icon": "dynamodb.svg" } diff --git a/airbyte-integrations/connectors/destination-dynamodb/Dockerfile b/airbyte-integrations/connectors/destination-dynamodb/Dockerfile index 28fbe4e9bb4a..1f4543e8b882 100644 --- a/airbyte-integrations/connectors/destination-dynamodb/Dockerfile +++ b/airbyte-integrations/connectors/destination-dynamodb/Dockerfile @@ -16,5 +16,5 @@ ENV APPLICATION destination-dynamodb COPY --from=build /airbyte /airbyte -LABEL io.airbyte.version=0.1.0 +LABEL io.airbyte.version=0.1.1 LABEL io.airbyte.name=airbyte/destination-dynamodb diff --git a/airbyte-integrations/connectors/destination-dynamodb/sample_secrets/config.json b/airbyte-integrations/connectors/destination-dynamodb/sample_secrets/config.json index 580e6fad531b..f7b1bf52cfa0 100644 --- a/airbyte-integrations/connectors/destination-dynamodb/sample_secrets/config.json +++ b/airbyte-integrations/connectors/destination-dynamodb/sample_secrets/config.json @@ -1,5 +1,5 @@ { - "dynamodb_table_name": "paste-table-name-here", + "dynamodb_table_name_prefix": "paste-table-name-here", "dynamodb_region": "paste-dynamodb-region-here", "access_key_id": "paste-access-key-id-here", "secret_access_key": "paste-secret-access-key-here" diff --git a/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbChecker.java b/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbChecker.java index 8819cc618c1e..9a3bb3603b34 100644 --- a/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbChecker.java +++ b/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbChecker.java @@ -23,7 +23,7 @@ public class DynamodbChecker { private static final Logger LOGGER = LoggerFactory.getLogger(DynamodbChecker.class); public static void attemptDynamodbWriteAndDelete(final DynamodbDestinationConfig dynamodbDestinationConfig) throws Exception { - final var prefix = dynamodbDestinationConfig.getTableName(); + final var prefix = dynamodbDestinationConfig.getTableNamePrefix(); final String outputTableName = prefix + "_airbyte_connection_test_" + UUID.randomUUID().toString().replaceAll("-", ""); attemptWriteAndDeleteDynamodbItem(dynamodbDestinationConfig, outputTableName); } diff --git a/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbDestinationConfig.java b/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbDestinationConfig.java index f69878b44b8a..9e3823fe9e37 100644 --- a/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbDestinationConfig.java +++ b/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbDestinationConfig.java @@ -9,19 +9,19 @@ public class DynamodbDestinationConfig { private final String endpoint; - private final String tableName; + private final String tableNamePrefix; private final String accessKeyId; private final String secretAccessKey; private final String region; public DynamodbDestinationConfig( final String endpoint, - final String tableName, + final String tableNamePrefix, final String region, final String accessKeyId, final String secretAccessKey) { this.endpoint = endpoint; - this.tableName = tableName; + this.tableNamePrefix = tableNamePrefix; this.region = region; this.accessKeyId = accessKeyId; this.secretAccessKey = secretAccessKey; @@ -30,7 +30,7 @@ public DynamodbDestinationConfig( public static DynamodbDestinationConfig getDynamodbDestinationConfig(final JsonNode config) { return new DynamodbDestinationConfig( config.get("dynamodb_endpoint") == null ? "" : config.get("dynamodb_endpoint").asText(), - config.get("dynamodb_table_name").asText(), + config.get("dynamodb_table_name_prefix").asText(), config.get("dynamodb_region").asText(), config.get("access_key_id").asText(), config.get("secret_access_key").asText()); @@ -52,8 +52,8 @@ public String getRegion() { return region; } - public String getTableName() { - return tableName; + public String getTableNamePrefix() { + return tableNamePrefix; } } diff --git a/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbOutputTableHelper.java b/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbOutputTableHelper.java index 6709a56ae823..abdf07191798 100644 --- a/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbOutputTableHelper.java +++ b/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbOutputTableHelper.java @@ -11,15 +11,15 @@ public class DynamodbOutputTableHelper { - public static String getOutputTableName(final String tableName, final AirbyteStream stream) { - return getOutputTableName(tableName, stream.getNamespace(), stream.getName()); + public static String getOutputTableName(final String tableNamePrefix, final AirbyteStream stream) { + return getOutputTableName(tableNamePrefix, stream.getNamespace(), stream.getName()); } - public static String getOutputTableName(final String tableName, final String namespace, final String streamName) { + public static String getOutputTableName(final String tableNamePrefix, final String namespace, final String streamName) { final List paths = new LinkedList<>(); - if (tableName != null) { - paths.add(tableName); + if (tableNamePrefix != null) { + paths.add(tableNamePrefix); } if (namespace != null) { paths.add(new ExtendedNameTransformer().convertStreamName(namespace)); diff --git a/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbWriter.java b/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbWriter.java index 5c2ca3e798c9..9f116de2d2c7 100644 --- a/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbWriter.java +++ b/airbyte-integrations/connectors/destination-dynamodb/src/main/java/io/airbyte/integrations/destination/dynamodb/DynamodbWriter.java @@ -46,7 +46,7 @@ public DynamodbWriter(final DynamodbDestinationConfig config, this.dynamodb = new DynamoDB(amazonDynamodb); this.configuredStream = configuredStream; this.uploadTimestamp = uploadTimestamp; - this.outputTableName = DynamodbOutputTableHelper.getOutputTableName(config.getTableName(), configuredStream.getStream()); + this.outputTableName = DynamodbOutputTableHelper.getOutputTableName(config.getTableNamePrefix(), configuredStream.getStream()); final DestinationSyncMode syncMode = configuredStream.getDestinationSyncMode(); if (syncMode == null) { diff --git a/airbyte-integrations/connectors/destination-dynamodb/src/main/resources/spec.json b/airbyte-integrations/connectors/destination-dynamodb/src/main/resources/spec.json index 87e9218a7260..5463149917e1 100644 --- a/airbyte-integrations/connectors/destination-dynamodb/src/main/resources/spec.json +++ b/airbyte-integrations/connectors/destination-dynamodb/src/main/resources/spec.json @@ -9,7 +9,7 @@ "title": "DynamoDB Destination Spec", "type": "object", "required": [ - "dynamodb_table_name", + "dynamodb_table_name_prefix", "dynamodb_region", "access_key_id", "secret_access_key" @@ -23,10 +23,10 @@ "description": "This is your DynamoDB endpoint url.(if you are working with AWS DynamoDB, just leave empty).", "examples": ["http://localhost:9000"] }, - "dynamodb_table_name": { - "title": "DynamoDB Table Name", + "dynamodb_table_name_prefix": { + "title": "Table name prefix", "type": "string", - "description": "The name of the DynamoDB table.", + "description": "The prefix to use when naming DynamoDB tables.", "examples": ["airbyte_sync"] }, "dynamodb_region": { diff --git a/airbyte-integrations/connectors/destination-dynamodb/src/test-integration/java/io/airbyte/integrations/destination/dynamodb/DynamodbDestinationAcceptanceTest.java b/airbyte-integrations/connectors/destination-dynamodb/src/test-integration/java/io/airbyte/integrations/destination/dynamodb/DynamodbDestinationAcceptanceTest.java index b08b405ac52b..122e44f118f0 100644 --- a/airbyte-integrations/connectors/destination-dynamodb/src/test-integration/java/io/airbyte/integrations/destination/dynamodb/DynamodbDestinationAcceptanceTest.java +++ b/airbyte-integrations/connectors/destination-dynamodb/src/test-integration/java/io/airbyte/integrations/destination/dynamodb/DynamodbDestinationAcceptanceTest.java @@ -66,7 +66,7 @@ protected JsonNode getFailCheckConfig() { */ protected List getAllSyncedObjects(final String streamName, final String namespace) { final var dynamodb = new DynamoDB(this.client); - final var tableName = DynamodbOutputTableHelper.getOutputTableName(this.config.getTableName(), streamName, namespace); + final var tableName = DynamodbOutputTableHelper.getOutputTableName(this.config.getTableNamePrefix(), streamName, namespace); final var table = dynamodb.getTable(tableName); final List items = new ArrayList(); final List resultItems = new ArrayList(); @@ -148,7 +148,7 @@ protected void tearDown(final TestDestinationEnv testEnv) { final var dynamodb = new DynamoDB(this.client); final List tables = new ArrayList(); dynamodb.listTables().forEach(o -> { - if (o.getTableName().startsWith(this.config.getTableName())) + if (o.getTableName().startsWith(this.config.getTableNamePrefix())) tables.add(o.getTableName()); }); diff --git a/airbyte-integrations/connectors/destination-dynamodb/src/test/java/io/airbyte/integrations/destination/dynamodb/DynamodbDestinationTest.java b/airbyte-integrations/connectors/destination-dynamodb/src/test/java/io/airbyte/integrations/destination/dynamodb/DynamodbDestinationTest.java index 1e2631e4c842..ceff78a832e0 100644 --- a/airbyte-integrations/connectors/destination-dynamodb/src/test/java/io/airbyte/integrations/destination/dynamodb/DynamodbDestinationTest.java +++ b/airbyte-integrations/connectors/destination-dynamodb/src/test/java/io/airbyte/integrations/destination/dynamodb/DynamodbDestinationTest.java @@ -31,14 +31,14 @@ void testGetOutputTableNameWithStream() throws Exception { @Test void testGetDynamodbDestinationdbConfig() throws Exception { final JsonNode json = Jsons.deserialize("{\n" + - " \"dynamodb_table_name\": \"test_table\",\n" + + " \"dynamodb_table_name_prefix\": \"test_table\",\n" + " \"dynamodb_region\": \"test_region\",\n" + " \"access_key_id\": \"test_key_id\",\n" + " \"secret_access_key\": \"test_access_key\"\n" + "}"); final var config = DynamodbDestinationConfig.getDynamodbDestinationConfig(json); - assertEquals(config.getTableName(), "test_table"); + assertEquals(config.getTableNamePrefix(), "test_table"); assertEquals(config.getRegion(), "test_region"); assertEquals(config.getAccessKeyId(), "test_key_id"); assertEquals(config.getSecretAccessKey(), "test_access_key"); diff --git a/docs/integrations/destinations/dynamodb.md b/docs/integrations/destinations/dynamodb.md index 5e01c7e43a22..a151a3dbca75 100644 --- a/docs/integrations/destinations/dynamodb.md +++ b/docs/integrations/destinations/dynamodb.md @@ -58,5 +58,6 @@ This connector by default uses 10 capacity units for both Read and Write in Dyna | Version | Date | Pull Request | Subject | | :--- | :--- | :--- | :--- | +| 0.1.1 | 2022-12-05 | [\#9314](https://github.com/airbytehq/airbyte/pull/9314) | Rename dynamo_db_table_name to dynamo_db_table_name_prefix. | | 0.1.0 | 2021-08-20 | [\#5561](https://github.com/airbytehq/airbyte/pull/5561) | Initial release. |