You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add GeoArrow export support for GEOGRAPHY/GEOMETRY columns
Detect GEOGRAPHY/GEOMETRY columns during query execution and tag them
with geoarrow.wkb Arrow extension metadata, enabling DuckDB and other
Arrow consumers to receive native geometry types with CRS information.
How it works:
1. Set GEOGRAPHY/GEOMETRY_OUTPUT_FORMAT=WKB at connection time so geo
columns arrive as binary WKB instead of GeoJSON strings
2. Before executing a query, extract the table name and run DESCRIBE
TABLE to identify GEOGRAPHY/GEOMETRY columns (catalog metadata is
unaffected by the WKB output format setting)
3. Tag identified columns with geoarrow.wkb extension metadata in the
Arrow schema — GEOGRAPHY gets CRS "EPSG:4326", GEOMETRY gets no CRS
4. Data flows as binary WKB with zero conversion overhead
Note: Snowflake's REST API reports geo columns as "binary" in rowtype
metadata when WKB output format is set, losing the original type info.
This is why we need the separate DESCRIBE TABLE query. We've reported
this to Snowflake.
Limitations (documented as TODOs):
- GEOMETRY SRID: requires data inspection to determine, same cross-driver
issue as adbc-drivers/redshift#2 and adbc-drivers/databricks#350
- Arbitrary queries: only table scans (SELECT ... FROM table) get geoarrow
metadata. Complex queries with joins/subqueries don't trigger geo
detection. The data is still correct WKB, just without the metadata.
Tested end-to-end: DuckDB reads Snowflake GEOGRAPHY as native GEOMETRY
with CRS EPSG:4326, and GeoParquet export preserves the type.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments