haishui created FLINK-35497:
-------------------------------
Summary: The wrong enum value was used to get month in
timestampDiff
Key: FLINK-35497
URL: https://issues.apache.org/jira/browse/FLINK-35497
Project: Flink
Issue Type: Bug
Components: Flink CDC
Affects Versions: cdc-3.1.0
Reporter: haishui
In
[SystemFunctionUtils#timestampDiff](https://github.com/apache/flink-cdc/blob/master/flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/functions/SystemFunctionUtils.java#L125):
{code:java}
case "MONTH":
return to.get(Calendar.YEAR) * 12
+ to.get(Calendar.MONDAY)
- (from.get(Calendar.YEAR) * 12 + from.get(Calendar.MONDAY)); {code}
The Calendar.MONDAY can be replaced with Calendar.MONTH.
This does not affect the calculation results, because Calendar.MONDAY =
Calendar.MONTH = 2.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)