chestnut-c commented on code in PR #8515:
URL: https://github.com/apache/inlong/pull/8515#discussion_r1263780313
##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/fieldtype/strategy/ClickHouseFieldTypeStrategy.java:
##########
@@ -31,12 +34,23 @@ public class ClickHouseFieldTypeStrategy implements
FieldTypeMappingStrategy {
private final FieldTypeMappingReader reader;
+ private final static String NULLABLE_PATTERN = "^NULLABLE\\((.*)\\)$";
+
+ private static final Pattern PATTERN = Pattern.compile(NULLABLE_PATTERN);
+
public ClickHouseFieldTypeStrategy() {
this.reader = new FieldTypeMappingReader(DataNodeType.CLICKHOUSE);
}
@Override
public String getFieldTypeMapping(String sourceType) {
+ // support clickHouse field type special modifier Nullable
+ if (StringUtils.isNotBlank(sourceType)) {
+ Matcher matcher = PATTERN.matcher(sourceType.toUpperCase());
+ if (matcher.matches()) {
+ sourceType = matcher.group(1);
Review Comment:
> Okay, I found the example in UT. Please add an example comment before
`sourceType = matcher.group(1);`, thanks.
ok
--
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]