-
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 type_id and type_name t-sql functions #1860
Merged
Deepesh125
merged 39 commits into
babelfish-for-postgresql:BABEL_3_X_DEV
from
amazon-aurora:JIRA-BABEL-803
Nov 7, 2023
Merged
support type_id and type_name t-sql functions #1860
Deepesh125
merged 39 commits into
babelfish-for-postgresql:BABEL_3_X_DEV
from
amazon-aurora:JIRA-BABEL-803
Nov 7, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
rishabhtanwar29
approved these changes
Oct 3, 2023
ahmed-shameem
suggested changes
Oct 3, 2023
Deepesh125
requested changes
Oct 4, 2023
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
vaibhav412
requested review from
ahmed-shameem,
rishabhtanwar29 and
Deepesh125
October 19, 2023 06:14
ahmed-shameem
suggested changes
Oct 19, 2023
Deepesh125
requested changes
Oct 23, 2023
vaibhav412
force-pushed
the
JIRA-BABEL-803
branch
from
October 25, 2023 09:21
e4295ca
to
c8ef3c2
Compare
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Signed-off-by: Vaibhav Agarwal <[email protected]>
Deepesh125
previously approved these changes
Oct 27, 2023
ahmed-shameem
suggested changes
Oct 30, 2023
contrib/babelfishpg_tsql/sql/upgrades/babelfishpg_tsql--3.3.0--3.4.0.sql
Show resolved
Hide resolved
Signed-off-by: Vaibhav Agarwal <[email protected]>
ahmed-shameem
approved these changes
Nov 6, 2023
Deepesh125
requested changes
Nov 7, 2023
Signed-off-by: Vaibhav Agarwal <[email protected]>
Deepesh125
approved these changes
Nov 7, 2023
Deepesh125
merged commit Nov 7, 2023
a26d448
into
babelfish-for-postgresql:BABEL_3_X_DEV
28 checks passed
staticlibs
pushed a commit
to wiltondb/babelfish_extensions
that referenced
this pull request
Oct 20, 2024
…ql#1860) This commit intends to support two T-SQL Functions, TYPE_ID() and TYPE_NAME(). 1. TYPE_ID() Input: [schema_name].[type_name] OR [type_name] Output: user_type_id of the datatype Info: Datatype can be user defined or system default datatype. -> For User Defined datatype: If new type is created in default schema & same typename is created in another schema, then both will have different type_id depending on whether schema is specified. Example: TYPE_NAME('NewSchema.NewType'), TYPE_ID('NewType') - Both will have different type_id because later one will try to search in default user schema or guest schema. -> System datatype: Example: TYPE_ID('int'), TYPE_ID('sys.int'), TYPE_ID('pg_catalog.int') - All will give same type_id unless user defined type with same name is created in other schema and input is schema qualified. (b) TYPE_NAME() Input: [type_id] Output: name of the datatype Info: It will give the name of the datatype as mapped according to the input type_id. Example: TYPE_NAME(36) Task: BABEL-803 Signed-off-by: Vaibhav Agarwal <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This commit intends to support TYPE_ID() & TYPE_NAME() T-SQL Functions.
(a) TYPE_ID()
Input: [schema_name].[type_name] OR [type_name]
Output: user_type_id of the datatype
Info: Datatype can be user defined or system default datatype.
-> User Defined datatype:
If new type is created in default schema & same typename is created in another schema, then both will have different type_id.
Example: TYPE_NAME('NewSchema.NewType'), TYPE_ID('NewType') - Both will have different type_id
-> System datatype:
Example: TYPE_ID('int'), TYPE_ID('sys.int'), TYPE_ID('pg_catalog.int') - All will give same type_id.
Reference: Doc
(b) TYPE_NAME()
Input: [type_id]
Output: name of the datatype
Info: It will give the name of the datatype as mapped according to the input type_id.
Example: TYPE_NAME(36)
Reference: Doc
Authored-by: Vaibhav Agarwal [email protected]
Signed-off-by: Vaibhav Agarwal [email protected]
Issues Resolved
[BABEL-803]
Test Scenarios Covered
Use case based -
Added test cases and covered different possible scenarios.
Boundary conditions - N/A
Arbitrary inputs - N/A
Negative test cases - N/A
Minor version upgrade tests - N/A
Major version upgrade tests - N/A
Performance tests - N/A
Tooling impact - N/A
Client tests - N/A
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.