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

feat(query): to_timestamp support parser string to ts without timezone #15131

Merged
merged 3 commits into from
Mar 30, 2024

Conversation

TCeason
Copy link
Collaborator

@TCeason TCeason commented Mar 29, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

if param format not contains ["%Z", "%z", "%:z", "%::z", "%:::z", "%#z"] use DateTime::parse_from_str else use NaiveDateTime::parse_from_str

select to_timestamp('2022/02/04/ 8-58-59', '%Y/%m/%d/ %H-%M-%S') as dt;
+----------------------------+
| dt                         |
+----------------------------+
| 2022-02-04 08:58:59.000000 |
+----------------------------+
  • Fixes #[Link the issue here]

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Mar 29, 2024
@TCeason TCeason force-pushed the function branch 5 times, most recently from 04ee504 to 381c826 Compare March 29, 2024 15:51
@TCeason TCeason changed the title feat(query): add to_unix_timestamp support parser string to ts without timezone feat(query): to_timestamp support parser string to ts without timezone Mar 29, 2024
@TCeason TCeason force-pushed the function branch 2 times, most recently from 075eb06 to 341a089 Compare March 29, 2024 15:59
@TCeason TCeason requested a review from sundy-li March 29, 2024 15:59
…ezone

```sql
select to_timestamp('2022/02/04/ 8-58-59', '%Y/%m/%d/ %H-%M-%S') as dt;
+----------------------------+
| dt                         |
+----------------------------+
| 2022-02-04 08:58:59.000000 |
+----------------------------+

```
@sundy-li sundy-li added this pull request to the merge queue Mar 30, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 30, 2024
@BohuTANG BohuTANG merged commit 79d8329 into databendlabs:main Mar 30, 2024
72 checks passed
@BohuTANG
Copy link
Member

@soyeric128 This feature needs documentation updated. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants