JingsongLi commented on code in PR #5086: URL: https://github.com/apache/paimon/pull/5086#discussion_r1962829746
########## paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/action/cdc/Expression.java: ########## @@ -608,4 +618,37 @@ public String eval(String input) { return value; } } + + /** Get current timestamp. */ + final class AuditTimeExpression implements Expression { + + private final boolean insertOnly; + private final String fieldReference; + + public AuditTimeExpression(boolean insertOnly) { + this.insertOnly = insertOnly; + this.fieldReference = SpecialFields.VALUE_KIND.name(); + } + + @Override + public String fieldReference() { + return this.fieldReference; + } + + @Override + public DataType outputType() { + return DataTypes.TIMESTAMP(); + } + + @Override + public String eval(String input) { + RowKind rowKind = RowKind.fromShortString(input); + String now = java.sql.Timestamp.valueOf(LocalDateTime.now()).toString(); + if (rowKind == RowKind.INSERT) { + return now; + } + + return insertOnly ? null : now; Review Comment: So if a new input update the record, the create_time will become null? -- 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