Skip to content

fix!: preserve unindexed fragments during zonemap pruning - #754

Open
ddupg wants to merge 2 commits into
lance-format:mainfrom
ddupg:fix/ddu-305-zonemap-partial-coverage
Open

fix!: preserve unindexed fragments during zonemap pruning#754
ddupg wants to merge 2 commits into
lance-format:mainfrom
ddupg:fix/ddu-305-zonemap-partial-coverage

Conversation

@ddupg

@ddupg ddupg commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve live fragments that are not covered by Zonemap stats during driver-side pruning
  • ignore retired fragment stats and require full live-fragment coverage before advertising storage partitioning
  • weight post-pruning row and size estimates by the surviving fragment row counts
  • add regression coverage for append-after-index filtering and partial-coverage SPJ fallback

Problem

Zonemap stats only describe indexed fragments. After an append, treating the returned stats as complete could drop the new fragment before Lance scans it. The same assumption could advertise KeyGroupedPartitioning without a trustworthy key for every live fragment.

Testing

  • ./mvnw test -pl lance-spark-3.5_2.13 -am -Dtest=LanceStatisticsTest,ZonemapFragmentPrunerTest,SparkLanceShardingUtilsTest,LanceScanTest -Dsurefire.failIfNoSpecifiedTests=false
  • ./mvnw test -pl lance-spark-3.5_2.12 -am -Dtest=BucketSpjTest -Dsurefire.failIfNoSpecifiedTests=false
  • final LanceStatisticsTest run: 16 tests passed
  • Spotless, Checkstyle, Python integration-test syntax check, and git diff --check passed

@github-actions github-actions Bot added the bug Something isn't working label Aug 10, 2026
@ddupg
ddupg marked this pull request as ready for review August 10, 2026 12:27
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Aug 10, 2026
@ddupg ddupg changed the title fix: preserve unindexed fragments during zonemap pruning fix!: preserve unindexed fragments during zonemap pruning Aug 10, 2026
@github-actions github-actions Bot added the breaking-change Features that introduces a breaking API change label Aug 10, 2026
@ddupg
ddupg force-pushed the fix/ddu-305-zonemap-partial-coverage branch from 7d1b88c to c7c57d5 Compare August 24, 2026 06:23
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Aug 24, 2026

@lance-gatekeeper lance-gatekeeper 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.

Gate recommendation: approve.

The rebased implementation preserves the prior result. Resolving the LanceRef into the scan plan and passing that resolved reference to workers keeps live-fragment discovery, zonemap statistics, split planning, and reads on the same dataset snapshot.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Features that introduces a breaking API change bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant