JNSimba commented on code in PR #464: URL: https://github.com/apache/doris-flink-connector/pull/464#discussion_r1706626314
########## flink-doris-connector/src/main/java/org/apache/doris/flink/sink/schema/SQLParserSchemaManager.java: ########## @@ -267,11 +280,28 @@ private String processRenameColumnOperation( } @VisibleForTesting - public String extractDefaultValue(List<String> columnSpecs) { + public String extractDefaultValue(String dateType, List<String> columnSpecs) { if (CollectionUtils.isEmpty(columnSpecs)) { return null; } - return extractAdjacentString(columnSpecs, DEFAULT); + String adjacentDefaultValue = extractAdjacentString(columnSpecs, DEFAULT); + return parseDorisDefaultValue(dateType, adjacentDefaultValue); + } + + private String parseDorisDefaultValue(String dateType, String defaultValue) { + if (Objects.isNull(defaultValue)) { + return null; + } + // In doris, DATETIME supports specifying the current time by default through + // CURRENT_TIMESTAMP. + if (dateType.startsWith(DorisType.DATETIME) || dateType.startsWith(DorisType.DATETIME_V2)) { + for (String timeValue : sourceConnectorTimeValues) { + if (timeValue.equalsIgnoreCase(defaultValue)) { + return DORIS_CURRENT_TIMESTAMP; + } + } Review Comment: Why not use sourceConnectorTimeValues.contains? -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org