Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-36647][transform] Support Timestampdiff and Timestampadd function in cdc pipeline transform #3698

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aiwenmo
Copy link
Contributor

@aiwenmo aiwenmo commented Nov 7, 2024

Support TimestampDiff function in cdc pipeline transform.

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

TIMESTAMP_DIFF('DAY', TO_TIMESTAMP('1970-01-01 00:00:00'), TO_TIMESTAMP('1970-01-02 00:00:00')) = 1 

The Timestampdiff and Timestampadd 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.
TIMESTAMPADD(timeintervalunit, interval, timepoint) N/A

I have implemented the Timestampdiff and Timestampadd function with the same definition as Flink.

TIMESTAMPDIFF(DAY, TO_TIMESTAMP('1970-01-01 00:00:00'), TO_TIMESTAMP('1970-01-02 00:00:00')) = 1  
TIMESTAMPADD(DAY, 1, TO_TIMESTAMP('1970-01-02 00:00:00'))

@github-actions github-actions bot added the docs Improvements or additions to documentation label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant