-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve error message for tables with invalid columns as cursor (#15317)
* implement validation for cursor type before reading data * rename class * add test * fix merge conflicts * address review comments * fix test
- Loading branch information
1 parent
123971a
commit 43076ee
Showing
5 changed files
with
127 additions
and
0 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
26 changes: 26 additions & 0 deletions
26
...-db/src/main/java/io/airbyte/integrations/source/relationaldb/InvalidCursorException.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,26 @@ | ||
package io.airbyte.integrations.source.relationaldb; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public class InvalidCursorException extends RuntimeException { | ||
|
||
public InvalidCursorException(final List<InvalidCursorInfo> tablesWithInvalidCursor) { | ||
super("The following tables have invalid columns selected as cursor, please select a column with a well-defined ordering as a cursor. " + tablesWithInvalidCursor.stream().map(InvalidCursorInfo::toString) | ||
.collect(Collectors.joining(","))); | ||
} | ||
|
||
public record InvalidCursorInfo(String tableName, String cursorColumnName, String cursorSqlType) { | ||
|
||
@Override | ||
public String toString() { | ||
return "{" + | ||
"tableName='" + tableName + '\'' + | ||
", cursorColumnName='" + cursorColumnName + '\'' + | ||
", cursorSqlType=" + cursorSqlType + | ||
'}'; | ||
} | ||
} | ||
|
||
|
||
} |