Wenkai Qi created FLINK-36647:
---------------------------------

             Summary: Support TimestampDiff function in cdc pipeline transform
                 Key: FLINK-36647
                 URL: https://issues.apache.org/jira/browse/FLINK-36647
             Project: Flink
          Issue Type: Improvement
          Components: Flink CDC
    Affects Versions: cdc-3.2.0
            Reporter: Wenkai Qi


Support TimestampDiff function in cdc pipeline transform.

Now. The TimestampDiff function implemented in the current code of CDC is as 
follows:

 
{code:java}
TIMESTAMP_DIFF('DAY', TO_TIMESTAMP('1970-01-01 00:00:00'), 
TO_TIMESTAMP('1970-01-02 00:00:00')) = 1 {code}
The TimestampDiff function implemented in Flink SQL is as follows:

 

 
||SQL Function||Table Function|| ||
|TIMESTAMPDIFF(timepointunit, timepoint1, 
timepoint2)|timestampDiff(TIMEPOINTUNIT, TIMEPOINT1, TIMEPOINT2)|Returns the 
(signed) number of timepointunit between timepoint1 and timepoint2. The unit 
for the interval is given by the first argument, which should be one of the 
following values: SECOND, MINUTE, HOUR, DAY, MONTH, or YEAR.|

 

I have implemented the TimestampDiff  function with the same definition as 
Flink.

 
{code:java}
TIMESTAMPDIFF(DAY, TO_TIMESTAMP('1970-01-01 00:00:00'), 
TO_TIMESTAMP('1970-01-02 00:00:00')) = 1  {code}
I will pull request. Should we keep the old implementation?

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to