Repository navigation
Read a geometry set as text as every set reads - #463
Merged
estebanzimanyi merged 1 commit intoOct 18, 2026
Merged
Conversation
geomset and geogset cast to VARCHAR through SetFunctions::Set_to_text, the cast every other set
type takes in SetTypes::RegisterCastFunctions, which writes the set with MEOS's set_out: each
element as its hexadecimal extended WKB, as MobilityDB's geomset::text writes it.
SpatialSetType::RegisterCastFunctions registers these two beside the casts from VARCHAR it holds.
Witness: on main `SELECT (geomset '{Point(1 1), Point(2 2)}')::VARCHAR` answers the raw bytes of
the value, `\xE0\x02\x00\x00+*\x12\x00...`, DuckDB's cast of a BLOB, where MobilityDB answers
{"0101000000000000000000F03F000000000000F03F", "010100000000000000000000400000000000000040"};
here MobilityDuck answers MobilityDB's text.
Measured: test/sql/geoset.test states a geometry set, a geography set and a geometry set with an
SRID, each read as text, against the text MobilityDB answers for the same values.
Why: a cast DuckDB applies wherever a VARCHAR is wanted shows a geometry set as its bytes, where
every other set shows its values.
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.
geomset and geogset cast to VARCHAR through SetFunctions::Set_to_text, the cast every other set
type takes in SetTypes::RegisterCastFunctions, which writes the set with MEOS's set_out: each
element as its hexadecimal extended WKB, as MobilityDB's geomset::text writes it.
SpatialSetType::RegisterCastFunctions registers these two beside the casts from VARCHAR it holds.
Witness: on main
SELECT (geomset '{Point(1 1), Point(2 2)}')::VARCHARanswers the raw bytes ofthe value,
\xE0\x02\x00\x00+*\x12\x00..., DuckDB's cast of a BLOB, where MobilityDB answers{"0101000000000000000000F03F000000000000F03F", "010100000000000000000000400000000000000040"};
here MobilityDuck answers MobilityDB's text.
Measured: test/sql/geoset.test states a geometry set, a geography set and a geometry set with an
SRID, each read as text, against the text MobilityDB answers for the same values.
Why: a cast DuckDB applies wherever a VARCHAR is wanted shows a geometry set as its bytes, where
every other set shows its values.