feat(duckdb): support reading geometry from postgres #11594
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.
Issues closed
Fixes #11585
Description of changes
GeospatialValue.to_binary()for duckdb. No direct test added, though this is tested indirectly by all of the geospatial tests.AsWKB()casts as described here whenever you tried to create a table from a select. eg you would getCREATE TABLE t as (SELECT asWKB(<col that is already binary>) as c from pg_table)With the casting pushed up to the backend level, now this bogus cast is removed.
I think this is the right abstraction? The other, maybe better way, would be to somehow detect if the expression is already a binary, and skip the asWKB conversion if so. But that seems like that might require runtime introspection of the DB, which I was trying to avoid.
TODOs
Deal with the failing tests. EDIT: actually, these look to be passing in CI, I think it is some mismatched dependencies in my local environment that are the issue?? I think there is actually nothing to do here.
There are two of them, both that look to be about rounding errors, eg
I would say just make these tests less fussy? Not exactly sure if this is actually indicative of a problem.