-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add primary key updates to schema change notifications (#14555)
- Loading branch information
1 parent
68cfa4e
commit 0dbd990
Showing
5 changed files
with
172 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ | |
import com.fasterxml.jackson.databind.node.ObjectNode; | ||
import io.airbyte.api.model.generated.CatalogDiff; | ||
import io.airbyte.api.model.generated.FieldTransform; | ||
import io.airbyte.api.model.generated.StreamAttributePrimaryKeyUpdate; | ||
import io.airbyte.api.model.generated.StreamAttributeTransform; | ||
import io.airbyte.api.model.generated.StreamDescriptor; | ||
import io.airbyte.api.model.generated.StreamTransform; | ||
import io.airbyte.api.model.generated.StreamTransform.TransformTypeEnum; | ||
|
@@ -217,7 +219,16 @@ void testBuildSchemaNotificationMessageData() { | |
.addTransformsItem( | ||
new StreamTransform().transformType(StreamTransform.TransformTypeEnum.ADD_STREAM).streamDescriptor(new StreamDescriptor().name("foo"))) | ||
.addTransformsItem(new StreamTransform().transformType(StreamTransform.TransformTypeEnum.REMOVE_STREAM) | ||
.streamDescriptor(new StreamDescriptor().name("removed"))); | ||
.streamDescriptor(new StreamDescriptor().name("removed"))) | ||
.addTransformsItem(new StreamTransform().transformType(StreamTransform.TransformTypeEnum.UPDATE_STREAM) | ||
.updateStream(new StreamTransformUpdateStream() | ||
.streamAttributeTransforms(List.of( | ||
new StreamAttributeTransform() | ||
.transformType(StreamAttributeTransform.TransformTypeEnum.UPDATE_PRIMARY_KEY) | ||
.updatePrimaryKey( | ||
new StreamAttributePrimaryKeyUpdate() | ||
.newPrimaryKey(List.of(List.of("new_pk"))))))) | ||
.streamDescriptor(new StreamDescriptor().name("stream_with_added_pk"))); | ||
String recipient = "[email protected]"; | ||
String transactionMessageId = "455"; | ||
SchemaUpdateNotification notification = SchemaUpdateNotification.builder() | ||
|
@@ -239,6 +250,7 @@ void testBuildSchemaNotificationMessageData() { | |
assertTrue(node.get("message_data").get("changes").get("deleted_streams").isArray()); | ||
assertEquals(1, node.get("message_data").get("changes").get("deleted_streams").size()); | ||
assertTrue(node.get("message_data").get("changes").get("modified_streams").isObject()); | ||
assertEquals(1, node.get("message_data").get("changes").get("deleted_streams").size()); | ||
assertEquals(1, node.get("message_data").get("changes").get("modified_streams").get("updatedStream").get("deleted").size()); | ||
} | ||
|
||
|
Oops, something went wrong.