JingsongLi commented on code in PR #1287: URL: https://github.com/apache/incubator-paimon/pull/1287#discussion_r1217854324
########## paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mysql/Expression.java: ########## @@ -136,6 +155,90 @@ public String eval(String input) { } } + /** Compute month from a time input. */ + final class MonthComputer implements Expression { + + private static final long serialVersionUID = 1L; + + private final String fieldReference; + + private MonthComputer(String fieldReference) { + this.fieldReference = fieldReference; + } + + @Override + public String fieldReference() { + return fieldReference; + } + + @Override + public DataType outputType() { + return DataTypes.INT(); + } + + @Override + public String eval(String input) { + LocalDateTime localDateTime = DateTimeUtils.toLocalDateTime(input, 0); Review Comment: Sorry, I did not mean to extract `DateTimeUtils.toLocalDateTime(input)`, just keep previous code is 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: issues-unsubscr...@paimon.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org