Skip to content

feat(bindings): expose geospatial result representation - #361

Merged
cathleeny merged 10 commits into
mainfrom
feat/geospatial-bindings
Oct 19, 2026
Merged

cathleeny merged 10 commits into
mainfrom
feat/geospatial-bindings

Conversation

@cathleeny

@cathleeny cathleeny commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • expose the optional geospatial result representation through Python, Node.js, and the C ABI
  • map true to canonical Arrow struct<srid,wkb> binary values and false to EWKT Arrow UTF-8 values
  • use the kernel's enabled binary default when callers omit the option
  • keep the representation choice entirely client-side and never synthesize or forward it to SEA
  • add binding unit tests, C wire/smoke coverage, public declarations, docs, and changelog entries

This is stacked on #360, which adds the typed Rust kernel option and local EWKT conversion. #365 provides the native binary Arrow foundation and schema reconciliation.

Testing

  • cargo fmt --all -- --check
  • denied-warning Clippy with both native TLS and rustls
  • cargo test --workspace --locked on every stack layer
  • PyO3: 25 Rust tests; pytest: 8 passed, 37 skipped; live string/binary smoke test
  • napi: 84 tests, generated-loader drift check, rebuilt addon, and live string/binary smoke test
  • C ABI compile/link smoke, including the geospatial setter
  • live Rust E2E: inline string/binary; 1M-row CloudFetch string/binary; geometry and geography; fixed and ANY SRID; nulls; empty geometry; and nested arrays

Live empty geospatial result-set queries currently fail in Reyden with XXR06 Partition 0 already finished. Non-geospatial empty results pass live, and geospatial empty-result schema handling is covered hermetically.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

@cathleeny
cathleeny added this pull request to stack #362 September 23, 2026 22:12
@cathleeny
cathleeny force-pushed the feat/geospatial-bindings branch from e3700a7 to 8548d4c Compare September 24, 2026 21:14

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

@cathleeny
cathleeny requested a review from a team as a code owner September 24, 2026 21:28

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 2 Low

Clean, well-covered change. The default flip from String to Binary geospatial representation is threaded consistently through every layer (kernel unwrap_or_default, napi unwrap_or(true), pyo3 signature default true, C ABI None → kernel default) with matching unit, wiremock, and C-smoke coverage, and the wiremock tests confirm the setting stays client-side and is never forwarded to SEA. Two minor API-surface notes inline (cross-binding naming spelling, and a boolean name that reads as a feature toggle rather than a representation choice); both are documented and non-blocking.

Comment thread napi/src/database.rs Resolved
Comment thread pyo3/src/session.rs Resolved

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good — a clean, well-tested bindings exposure. The kernel default flip from EWKT String to native SRID+WKB Binary is wired consistently through SessionConfig → PostProcessOptions → reader, documented in the changelog, and covered end-to-end by updated wiremock tests (including the client-side-only assertions that nothing reaches SEA). One Low: the option is spelled enable_geospatial_support in Python but enableGeoSpatialSupport in Node — a cross-binding naming divergence worth aligning.

Comment thread napi/index.d.ts Resolved
Signed-off-by: cat23123 <58714163+cat23123@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good — one low cross-binding naming inconsistency (enableGeoSpatialSupport in Node vs enable_geospatial_support elsewhere). The default flip to Binary and the new binding/C-ABI setters are consistent and well-covered by unit, wiremock, and C smoke tests; the legacy-text-under-Binary rejection path is tested. Note the default change is a behavior shift, but since the whole geospatial surface is unreleased (NEXT_CHANGELOG / stacked on #360), there is no released behavior to break.

Comment thread napi/src/database.rs Resolved
Signed-off-by: cat23123 <58714163+cat23123@users.noreply.github.com>
Signed-off-by: cat23123 <58714163+cat23123@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good — a clean, well-tested extension that exposes the geospatial representation toggle through all three bindings and flips the default to native SRID+WKB. The new text→native conversion path (text_to_native/ewkt_values_to_native/split_ewkt/normalize_multipoint_empty_members) is carefully bounds-checked (no slicing panics), the .expect("logical_tag implies a logical type") is provably safe (logical_tag is Some only when logical is Some), malformed input is surfaced as DataLoss without echoing values, and the EnableGeoSpatialSupport naming/semantics match the JDBC reference. Only one low-severity observation about per-row SRID fallback for unprefixed text; no blocking issues.

Comment thread src/reader/post_processor/geospatial.rs Resolved
Comment thread src/config.rs Resolved
Comment thread tests/v0_execute_wiremock.rs Resolved
@aakash-saravanan-db

Copy link
Copy Markdown
Collaborator

Could we clarify which option contract is intended? The summary says true selects EWKT and omission defaults to strings, while the binding code and docs say true and the default select binary.

Signed-off-by: cat23123 <58714163+cat23123@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Medium · 1 Low

Solid, well-tested change — the text↔native geospatial conversion, validity propagation, and client-side-only guarantee all hold up and have good hermetic coverage. Two non-blocking notes: a behavioral-risk flag on flipping the default to Binary (medium) and a cross-binding naming inconsistency (low).

Comment thread src/config.rs Resolved
Comment thread napi/src/database.rs Resolved

@aakash-saravanan-db aakash-saravanan-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we link the upstream Reyden issue for XXR06 Partition 0 already finished and identify the live zero-row regression test required to close it?

Both representation modes request the same server-side Arrow execution, so disabling this option cannot bypass that failure. Hermetic empty-schema coverage verifies the kernel behavior but does not establish that the end-to-end zero-row path works.

Comment thread src/reader/post_processor/geospatial.rs Resolved
Comment thread src/reader/post_processor/geospatial.rs Resolved
Comment thread src/reader/post_processor/geospatial.rs Resolved
Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Signed-off-by: cat23123 <58714163+cat23123@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good — a clean, well-tested binding/representation change (default geospatial representation flips to native SRID+WKB; standard-warehouse WKT/EWKT text is now parsed into the tagged struct in binary mode). The text↔native conversion, container-validity masking, slicing, and malformed-input redaction are all covered by thorough unit and wiremock tests; the three binding surfaces (PyO3/napi/C ABI) map the flag consistently and all keep the choice client-side (verified by the create-session wiremock assertions).

One low-severity note inline on the broadened NOT NULL nullability in parse_struct. Nit (not inlined): the user-facing option name is inconsistent across bindings — Python enable_geospatial_support and C ..._enable_geospatial_support use "geospatial" while Node enableGeoSpatialSupport capitalizes "GeoSpatial"; intentional to mirror the server conf key EnableGeoSpatialSupport, but may surprise cross-language users.

Comment thread src/metadata/type_mapping.rs Resolved
Signed-off-by: cat23123 <58714163+cat23123@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good overall — the text↔native geospatial conversion, container-validity masking, and the default flip to Binary are consistently wired across the kernel, C ABI, PyO3, and napi, with strong unit/wiremock coverage. One low-severity note: a stated "never echo result contents in errors" invariant has a gap on the WKT-parser error path (the no-echo test doesn't exercise it).

Comment thread src/reader/post_processor/geospatial.rs Resolved
Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good — a thorough, heavily-tested change that exposes the geospatial result representation through all three bindings and flips the kernel default to native SRID+WKB. The new text→native conversion logic (validate_wkt_boundary, split_ewkt, normalize_multipoint_empty_members, container validity masking) is well covered by the added unit/wiremock tests, the wkt dependency's license is already allow-listed in deny.toml, and the default-flip is wired consistently (Python =true, Node unwrap_or(true), C-ABI None→kernel default) with matching changelog entries. Note the default change is a deliberate behavioral break for existing binding users (EWKT strings → struct), documented in the changelogs. Only one minor cross-binding naming-consistency nit, inline.

Comment thread napi/index.d.ts Resolved
Signed-off-by: cat23123 <58714163+cat23123@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good — a well-structured, heavily-tested change that flips the default geospatial representation to native SRID+WKB and adds standard-warehouse WKT/EWKT→struct conversion across Python/Node/C bindings. The default flip and binding surface are intentional and documented in the changelogs/docs; the client-side-only guarantee is verified by wiremock tests. One low note: parse_struct's new NOT NULL handling now applies to all struct fields, slightly tightening nullability for non-geo structs too. No blocking issues.

Comment thread src/metadata/type_mapping.rs Resolved
Signed-off-by: cat23123 <58714163+cat23123@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Nit

Looks good — a clean, well-tested feature PR exposing the geospatial result representation across Python, Node, and the C ABI, plus the kernel default flip (String → Binary) and standard-warehouse WKT/EWKT → native SRID+WKB conversion. The post-processor changes (text_to_native, ancestor-validity propagation, EWKT boundary validation, MULTIPOINT-empty normalization, non-value-echoing error paths) are carefully guarded and backed by extensive hermetic coverage (nested/sliced/null-masking, both modes, every OGC family). The default-behavior change is intentional and documented in all three changelogs. Only one cosmetic naming-consistency nit.

Other findings

  • ⚪ Nit — Cross-binding naming is inconsistent: Node.js exposes enableGeoSpatialSupport (camel-cased "GeoSpatial" to match the server conf EnableGeoSpatialSupport), while Python uses enable_geospatial_support and the C ABI uses kernel_session_config_set_enable_geospatial_support (both lowercase "geospatial"). The divergence is intentional given each ecosystem's casing convention and the SEA conf spelling, so this is only a cosmetic note — users consulting docs across bindings may be briefly surprised. No change required unless you want a consistent token stem.

This branch was previously deployed

1 inactive deployment
azure-prod — 8121ce4e Deployed Oct 19, 2026 by cathleeny via review #942
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.

2 participants