Skip to content

fix(flink): unit is ignored when str cast to timestamp #11167

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ted0928
Copy link
Contributor

@ted0928 ted0928 commented Apr 28, 2025

Description of changes

When string like '2025-04-28 00:00:00' cast to dt.timestamp.from_unit('s'), the unit is ignored, sql is like:

TO_TIMESTAMP(COALESCE('2025-04-28 00:00:00','yyyy-MM-dd HH:mm:ss.SSS')

Fix it when unit is second:
TO_TIMESTAMP(COALESCE('2025-04-28 00:00:00')
the default value of the format string is 'yyyy-MM-dd HH:mm:ss' .

Issues closed

@github-actions github-actions bot added the sql Backends that generate SQL label Apr 28, 2025
@ted0928 ted0928 closed this Apr 28, 2025
@ted0928 ted0928 reopened this Apr 28, 2025
@ted0928 ted0928 marked this pull request as ready for review April 28, 2025 09:43
@ted0928 ted0928 force-pushed the main branch 2 times, most recently from 7591141 to 39964d7 Compare May 11, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql Backends that generate SQL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant