Implemetation of parse geography and geometry datatype (#4518)#4675
Merged
rishabhtanwar29 merged 1 commit intobabelfish-for-postgresql:BABEL_6_X_DEVfrom Mar 20, 2026
Merged
Conversation
…-postgresql#4518) Implemented Parse function support for GeoSpatial TSQL data types that was previously unsupported in Babelfish. The Parse function has been added for both geometry and geography data types. Changes include: Implemented geometry::Parse() and geography::Parse() functions by utilizing PostGIS parsing capabilities with necessary adjustments to ensure TSQL compatibility. Added Parse function definitions to the TSQL parser to recognize these new static methods. Ensured proper syntax handling for Parse function, including NVARCHAR parameter types and return values. Examples: DECLARE @geomText NVARCHAR(MAX); SET @geomText = 'POINT(1.0 2.0)'; SELECT geometry::Parse(@geomText).STAsText() AS ParsedGeometry; GO ParsedGeometry -------------- POINT(1 2) DECLARE @geogText NVARCHAR(MAX); SET @geogText = 'LINESTRING(0 0, 1 1, 2 2)'; SELECT geography::Parse(@geogText).STAsText() AS ParsedGeography; GO ParsedGeography --------------- LINESTRING(0 0,1 1,2 2) Task: BABEL-6310 Signed-off by: Gopalgv gopalgv@amazon.com
rishabhtanwar29
approved these changes
Mar 20, 2026
ddfccc9
into
babelfish-for-postgresql:BABEL_6_X_DEV
48 checks passed
This file contains hidden or 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
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
Implemented Parse function support for GeoSpatial TSQL data types that was previously unsupported in Babelfish. The Parse function has been added for both geometry and geography data types.
Changes include:
Function Implementation:
geometry::Parse()andgeography::Parse()functions by utilizing PostGIS parsing capabilities with necessary adjustments to ensure TSQL compatibility.Parser Updates:
Test Cases:
Error Handling:
Extending existing functionalities:
hierarchyid::Parse()support for completenessTesting:
Examples:
For
geometry::ParseOutput:
For
geography::ParseOutput:
For Empty Geometry Parsing
Output:
Issues Resolved
BABEL 6339
Signed-off by: Gopalgv gopalgv@amazon.com
Authored by: Gopalgv gopalgv@amazon.com
Check List
--signoffFor more information on following Developer Certificate of Origin and signing off your commits, please check here.