Skip to content

[core] Spill Hilbert sorting for large R-tree indexes - #11588

Draft
leaves12138 wants to merge 19 commits into
apache:masterfrom
leaves12138:codex/rtree-spillable-build
Draft

leaves12138 wants to merge 19 commits into
apache:masterfrom
leaves12138:codex/rtree-spillable-build

Conversation

@leaves12138

Copy link
Copy Markdown
Contributor

Purpose

Build larger packed R-tree indexes without keeping all geometry envelopes in memory. The writer computes the bounding box for one output tree, spills temporary records and sorted Hilbert runs to local disk when needed, and streams the final merge into leaf pages. Merge fan-in is bounded, and the reader streams large row-ID blocks.

Raise the supported file size to 10 million source rows while keeping the default at 65,536. A build can opt in to 10 million rows by setting both global-index.row-count-per-shard and rtree-index.partition-row-count to 10000000.

Tests

  • 83 targeted tests passed across Paimon Common, Core, and Flink, including spilled builds, row-block checksums, and global index reads.
  • A local smoke test built one R-tree file from 10 million points with -Xmx128m. A bounding-box query returned all 1,221 expected rows, and the temporary sort files were cleaned up.

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