Skip to content

[Docs] Document the geometry and geography types - #2374

Closed
timothyw553 wants to merge 6 commits into
unitycatalog:mainfrom
timothyw553:stack/geotypes-docs
Closed

timothyw553 wants to merge 6 commits into
unitycatalog:mainfrom
timothyw553:stack/geotypes-docs

Conversation

@timothyw553

@timothyw553 timothyw553 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

🥞 Stacked PR

Use this link to review incremental changes.


PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests! (docs only)
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

Documents GEOMETRY and GEOGRAPHY columns in the CLI and table usage guides, including --columns syntax, defaults (OGC:CRS84, spherical), supported algorithms, WKB hex output on read, and Spark/Delta runtime requirements (Spark 4.1+, spark.databricks.delta.geo.preview.enabled=true, and Spark 4.2+ for Parquet writes). Also covers Spark connector behavior from #2372, so this should merge after #2372 as well.

Docs-only change; verified markdown links and examples by inspection.

@timothyw553 timothyw553 changed the title Lists GEOMETRY / GEOGRAPHY (with CRS and algorithm) among the types table create accepts, and documents what using them needs: Spark 4.1 or later, Delta's geospatial preview flag (off by default), and Spark 4.2 or later to write geo values to Parquet. No linked issue yet. [Docs] Document the geometry and geography types Nov 24, 2026
@timothyw553
timothyw553 force-pushed the stack/geotypes-docs branch 4 times, most recently from 15d9dd0 to 07d8588 Compare November 27, 2026 10:47
timothyw553 and others added 6 commits November 30, 2026 10:09
Add GEOMETRY and GEOGRAPHY to ColumnTypeName in api/all.yaml (appended so existing ordinals stay unchanged).

Widen the ordinal CHECK constraints on uc_functions.data_type and uc_function_params.type_name from 0..21 to 0..23 across H2, PostgreSQL, and MySQL:
- V17 / V19 (SQL): add named CHECK (0..23) constraints on uc_functions and uc_function_params.
- V18 / V20 (Java migrations): look up and drop the old unnamed 0..21 CHECK constraints by clause so upgrades work on both fresh and repaired databases.

Update SchemaMigrator, MigrationStepRulesTest, and schema-effects for all three databases, and add SdkFunctionCRUDTest coverage for GEOMETRY and GEOGRAPHY function parameters and return types.

Signed-off-by: Timothy Wang <[email protected]>
Resolve the geo type strings Delta Kernel parses (geometry[(crs)],
geography[(crs[, algorithm])|(algorithm)]) to GEOMETRY and GEOGRAPHY, and
keep the string as type_text so the CRS and algorithm survive. type_json
already carries it. Without this a Delta table with a geo column is
rejected at create time as an unsupported primitive.

A geography algorithm Delta does not define is rejected with
INVALID_ARGUMENT, as Kernel does; other malformed forms fall through to the
existing unsupported-primitive error.

Co-authored-by: Isaac <[email protected]>
Signed-off-by: Timothy Wang <[email protected]>
Iceberg 1.11 defines geometry(crs) and geography(crs, algorithm), so map
them to GEOMETRY and GEOGRAPHY instead of rejecting the table, and drop the
comment that said Iceberg has no such types.

type_text and type_json carry the Delta form, geometry(<crs>) and
geography(<crs>, <algorithm>). Iceberg accepts any CRS string, but Delta
clients only parse <authority>:<code>, so another CRS is rejected up front
rather than stored as a type they can't read.

Co-authored-by: Isaac <[email protected]>
Signed-off-by: Timothy Wang <[email protected]>
Accept GEOMETRY and GEOGRAPHY, with an optional CRS and algorithm, in
`table create --columns`, and keep them in type_text and type_json. When
reading a Delta table, take a geo column's Kernel type from its type_json,
which holds the CRS and algorithm, and show its WKB value as hex instead of
failing with an unsupported data type.

Co-authored-by: Isaac <[email protected]>
Signed-off-by: Timothy Wang <[email protected]>
Add GEOMETRY and GEOGRAPHY to the ColumnTypeName proto enum, and map them
in the bridge. Without this a geo column in a table comes back as
UNSPECIFIED.

The bridge change was not compiled or tested here, because crates.io is
not reachable from the build host.

Co-authored-by: Isaac <[email protected]>
Signed-off-by: Timothy Wang <[email protected]>
List GEOMETRY and GEOGRAPHY, with their CRS and algorithm, among the types
`table create` accepts, and describe what using them needs: Spark 4.1 or
later, Delta's geospatial preview flag, and Spark 4.2 or later to write
geo values to Parquet.

Co-authored-by: Isaac <[email protected]>
Signed-off-by: Timothy Wang <[email protected]>
@timothyw553

Copy link
Copy Markdown
Collaborator Author

Folded into #2373.

@timothyw553
timothyw553 deleted the stack/geotypes-docs branch November 30, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant