Copilot commented on code in PR #9389:
URL: https://github.com/apache/seatunnel/pull/9389#discussion_r2123257563
##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/oracle/OracleTypeConverter.java:
##########
@@ -244,6 +252,11 @@ public Column convert(BasicTypeDefine typeDefine) {
builder.scale(typeDefine.getScale());
}
break;
+ case ORACLE_INTERVAL:
+ case ORACLE_INTERVAL_YEAR:
+ case ORACLE_INTERVAL_DAY:
+ builder.dataType(BasicType.STRING_TYPE);
+ break;
Review Comment:
Matching interval types by exact string may fail when the DB returns
precision in the type name (e.g., "INTERVAL DAY(2) TO SECOND(6)"). Consider
normalizing the typeDefine.getName() or using startsWith/contains to cover
variants with precision.
```suggestion
if (oracleType.startsWith("INTERVAL DAY")) {
builder.dataType(BasicType.STRING_TYPE);
} else if (oracleType.startsWith("INTERVAL YEAR")) {
builder.dataType(BasicType.STRING_TYPE);
} else if (oracleType.startsWith("INTERVAL")) {
builder.dataType(BasicType.STRING_TYPE);
} else {
throw CommonError.convertToSeaTunnelTypeError(
DatabaseIdentifier.ORACLE, oracleType,
typeDefine.getName());
}
break;
```
--
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]