trhlxc commented on issue #8529:
URL: https://github.com/apache/seatunnel/issues/8529#issuecomment-2609159620
# 2.3.9 edit
>
src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/AbstractJdbcCatalog.java
add
`//Get the base type of a field's custom type
public String getUserDefinedType( String sql, String UserDefinedType)
throws SQLException {
try (PreparedStatement ps =
getConnection(defaultUrl).prepareStatement(sql)) {
String result = null;
ps.setString(1, UserDefinedType);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
result = rs.getString(1);
}
return result;
}
}`
>org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/sqlserver/SqlServerCatalog.java
```
private static final String GET_USER_DEFINED_SQL =
"SELECT \n" +
" st.name AS BaseTypeName\n" +
"FROM sys.types t\n" +
"INNER JOIN sys.types st ON t.system_type_id =
st.user_type_id\n" +
"WHERE t.is_user_defined = 1\n" +
"AND t.name = ? ";
@Override
public String getUserDefinedType( String sql, String UserDefinedType)
throws SQLException {
try (PreparedStatement ps =
getConnection(defaultUrl).prepareStatement(sql)) {
String result = null;
ps.setString(1, UserDefinedType);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
result = rs.getString(1);
}
return result;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]