-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JDBC Destinations: improve error message for conflicting streams (#21342
) * catch conflicting streams as configerror * add test * bump version + changelog * derp, fix test setup * derp * auto-bump connector version Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
- Loading branch information
1 parent
954ca75
commit 1e44c34
Showing
6 changed files
with
70 additions
and
11 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
34 changes: 34 additions & 0 deletions
34
...src/test/java/io/airbyte/integrations/destination/staging/StagingConsumerFactoryTest.java
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.airbyte.integrations.destination.staging; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
import io.airbyte.commons.exceptions.ConfigErrorException; | ||
import io.airbyte.integrations.destination.jdbc.WriteConfig; | ||
import java.util.List; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class StagingConsumerFactoryTest { | ||
|
||
@Test() | ||
void detectConflictingStreams() { | ||
final StagingConsumerFactory f = new StagingConsumerFactory(); | ||
|
||
final ConfigErrorException configErrorException = assertThrows( | ||
ConfigErrorException.class, | ||
() -> f.flushBufferFunction( | ||
null, | ||
null, | ||
List.of( | ||
new WriteConfig("example_stream", "source_schema", "destination_default_schema", null, null, null), | ||
new WriteConfig("example_stream", "source_schema", "destination_default_schema", null, null, null) | ||
), | ||
null | ||
)); | ||
|
||
assertEquals( | ||
"You are trying to write multiple streams to the same table. Consider switching to a custom namespace format using ${SOURCE_NAMESPACE}, or moving one of them into a separate connection with a different stream prefix. Affected streams: source_schema.example_stream, source_schema.example_stream", | ||
configErrorException.getMessage() | ||
); | ||
} | ||
|
||
} |
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