Skip to content

feat: make geodatafusion/geoarrow optional via geo feature flag#5934

Merged
wjones127 merged 4 commits intolance-format:mainfrom
apoc:perf/disable-lance-geo-v-2
Feb 23, 2026
Merged

feat: make geodatafusion/geoarrow optional via geo feature flag#5934
wjones127 merged 4 commits intolance-format:mainfrom
apoc:perf/disable-lance-geo-v-2

Conversation

@apoc
Copy link
Copy Markdown
Contributor

@apoc apoc commented Feb 11, 2026

Make geospatial dependencies (geodatafusion, geoarrow-array, geoarrow-schema, geo-traits, geo-types) optional across the lance crate stack via a new geo feature flag.

This allows consumers that don't need spatial indexing or geospatial UDFs to avoid pulling in ~40 transitive dependencies and the associated runtime overhead of registering geo UDFs in every DataFusion SessionContext.

The geo feature is enabled by default in the top-level lance crate, preserving backward compatibility. Consumers can opt out with default-features = false.

Crates modified:

  • lance-geo: all geo deps made optional, bbox module gated
  • lance-datafusion: lance-geo made optional, geo UDF registration gated
  • lance-index: lance-geo + geoarrow deps optional, rtree module and RTreeIndexPlugin registration gated, geo bench requires feature
  • lance: geo feature added to defaults, propagates to sub-crates

@github-actions github-actions Bot added the enhancement New feature or request label Feb 11, 2026
Copy link
Copy Markdown
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

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

thanks for adding this, mostly looks good to me, pending CI

@apoc
Copy link
Copy Markdown
Contributor Author

apoc commented Feb 12, 2026

I am working on more gracefull error reporting when user uses GEO functions when GEO is featured out

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 63.63636% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance/src/index.rs 50.00% 3 Missing ⚠️
rust/lance/src/index/append.rs 50.00% 3 Missing ⚠️
rust/lance-index/src/registry.rs 77.77% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@apoc apoc force-pushed the perf/disable-lance-geo-v-2 branch from a35265b to 725e4ec Compare February 14, 2026 19:07
@wjones127 wjones127 changed the base branch from release/v2.0 to main February 23, 2026 19:12
MiroslavDrbal and others added 3 commits February 23, 2026 11:17
Make geospatial dependencies (geodatafusion, geoarrow-array,
geoarrow-schema, geo-traits, geo-types) optional across the lance
crate stack via a new `geo` feature flag.

This allows consumers that don't need spatial indexing or geospatial
UDFs to avoid pulling in ~40 transitive dependencies and the
associated runtime overhead of registering geo UDFs in every
DataFusion SessionContext.

The `geo` feature is enabled by default in the top-level `lance`
crate, preserving backward compatibility. Consumers can opt out
with `default-features = false`.

Crates modified:
- lance-geo: all geo deps made optional, bbox module gated
- lance-datafusion: lance-geo made optional, geo UDF registration gated
- lance-index: lance-geo + geoarrow deps optional, rtree module and
  RTreeIndexPlugin registration gated, geo bench requires feature
- lance: geo feature added to defaults, propagates to sub-crates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the `geo` feature is not enabled, users now get actionable errors
and graceful degradation instead of confusing failures:

- Registry: "No plugin for name 'rtree'" error now suggests enabling
  the `geo` feature
- scalar_index_info: skips unsupported geo indices with a warning,
  allowing non-geo filtered scans to work on datasets with RTree indices
- remap_index: drops geo indices gracefully during compaction instead
  of failing the entire operation
- merge_indices: skips index merge for unavailable plugins instead of
  blocking append operations
- UDFs: registers stub ST_* functions that return clear "enable geo
  feature" errors instead of DataFusion's generic "Unknown function"
- Dead code: gates GeoQuery, RelationQuery, and GeoQueryParser behind
  #[cfg(feature = "geo")] since they are unreachable without it

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wjones127 wjones127 force-pushed the perf/disable-lance-geo-v-2 branch from 0e88c7b to 09188a6 Compare February 23, 2026 19:17
@wjones127 wjones127 merged commit b34c406 into lance-format:main Feb 23, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request java python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants