Skip to content

Commit ae25ae4

Browse files
dujieFlechazoW
authored andcommitted
[hotfix-53587][sqlserver]support identity type
1 parent 9b703c6 commit ae25ae4

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

flinkx-connectors/flinkx-connector-sqlserver/src/main/java/com/dtstack/flinkx/connector/sqlserver/converter/SqlserverJtdsRawTypeConverter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ public class SqlserverJtdsRawTypeConverter {
4141
* @throws UnsupportedTypeException
4242
*/
4343
public static DataType apply(String type) throws UnsupportedTypeException {
44+
// like numeric() identity, decimal() identity
45+
if (type.contains("identity")) {
46+
type = type.replace("identity", "").trim();
47+
if (type.endsWith("()")) {
48+
type = type.replace("()", "").trim();
49+
}
50+
}
4451
switch (type.toUpperCase(Locale.ENGLISH)) {
4552
case "BIT":
4653
return DataTypes.BOOLEAN();

flinkx-connectors/flinkx-connector-sqlserver/src/main/java/com/dtstack/flinkx/connector/sqlserver/converter/SqlserverMicroSoftRawTypeConverter.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ public class SqlserverMicroSoftRawTypeConverter {
4242
* @throws UnsupportedTypeException
4343
*/
4444
public static DataType apply(String type) throws UnsupportedTypeException {
45+
// like numeric() identity, decimal() identity
46+
if (type.contains("identity")) {
47+
type = type.replace("identity", "").trim();
48+
if (type.endsWith("()")) {
49+
type = type.replace("()", "").trim();
50+
}
51+
}
52+
4553
switch (type.toUpperCase(Locale.ENGLISH)) {
4654
case "BIT":
4755
return DataTypes.BOOLEAN();

flinkx-core/src/main/java/com/dtstack/flinkx/enums/ColumnType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public enum ColumnType {
6363
SHORT,
6464
INTEGER,
6565
NUMBER,
66+
NUMERIC,
6667

6768
/** double type */
6869
DOUBLE,

0 commit comments

Comments
 (0)