-
Notifications
You must be signed in to change notification settings - Fork 94
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
support DATETRUNC() function #1846
support DATETRUNC() function #1846
Conversation
contrib/babelfishpg_tsql/sql/upgrades/babelfishpg_tsql--3.3.0--3.4.0.sql
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add limitation of this function in PR description with some examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve the merge conflicts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add all testcases from the doc and verify it against standard TSQL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved.
With this change, babelfish now supports function DATETRUNC(). The DATETRUNC function returns an input date truncated to a specified datepart. |
f40bde1
into
babelfish-for-postgresql:BABEL_3_X_DEV
* support DATETRUNC() function * test failures * code refectoring and some jdbc tests * test failure * Revert "test failure" This reverts commit bfcac2e. * address comments * address review comments Signed-off-by: Sandeep Kumawat <[email protected]> --------- Co-authored-by: Sandeep Kumawat <[email protected]>
* support DATETRUNC() function * test failures * code refectoring and some jdbc tests * test failure * Revert "test failure" This reverts commit bfcac2e. * address comments * address review comments Signed-off-by: Sandeep Kumawat <[email protected]> --------- Co-authored-by: Sandeep Kumawat <[email protected]>
Description
With this pull request babelfish now supports function DATETRUNC().
The DATETRUNC function returns an input date truncated to a specified datepart.
For the implementation of the 'DATETRUNC' function, the PostgreSQL 'date_trunc' function was utilized with certain custom modifications to meet specific requirements.
Example -
For detailed explanation -
Reference - https://github.com/MicrosoftDocs/sql-docs/blob/live/docs/t-sql/functions/datetrunc-transact-sql.md
Limitation
There are some limitation of current implementation of DATETRUNC() function, when a specific scale provided during casting to time, datetime2, datetimeoffset datatypes.
Example.
Example.
Signed-off-by: Sandeep Kumawat [email protected]
Issues Resolved
BABEL-3953
Test Scenarios Covered
Use case based - Added
Boundary conditions - Added
Arbitrary inputs - Added
Negative test cases - Added
Minor version upgrade tests- Added
Major version upgrade tests - Added
Performance tests - NA
Tooling impact - NA
Client tests - NA
Check List
By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.