feat(datafusion): Add LIMIT pushdown support#2006
Merged
liurenjie1024 merged 1 commit intoapache:mainfrom Jan 9, 2026
Merged
Conversation
c4a0132 to
5120001
Compare
Contributor
liurenjie1024
left a comment
There was a problem hiding this comment.
Thanks @viirya for this fix, just one minor issue.
| /// Filters to apply to the table scan | ||
| predicates: Option<Predicate>, | ||
| /// Optional limit on the number of rows to return | ||
| pub(crate) limit: Option<usize>, |
Contributor
There was a problem hiding this comment.
We should follow other fields to make field private and use function to expose it.
Implement LIMIT pushdown to optimize queries with LIMIT clauses by stopping data processing once the limit is reached. This reduces unnecessary I/O and computation for queries that only need a subset of rows. Changes: - Add limit field to IcebergTableScan to track row limit - Apply limit at stream level by filtering/slicing record batches - Update IcebergTableProvider and IcebergStaticTableProvider to pass limit parameter to scan - Add comprehensive tests for limit pushdown functionality Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
5120001 to
5b79254
Compare
liurenjie1024
approved these changes
Jan 9, 2026
Contributor
liurenjie1024
left a comment
There was a problem hiding this comment.
Thanks @viirya for this fix!
Member
Author
|
Thanks @liurenjie1024 |
gbrgr
pushed a commit
to RelationalAI/iceberg-rust
that referenced
this pull request
Jan 9, 2026
Implement LIMIT pushdown to optimize queries with LIMIT clauses by stopping data processing once the limit is reached. This reduces unnecessary I/O and computation for queries that only need a subset of rows. Changes: - Add limit field to IcebergTableScan to track row limit - Apply limit at stream level by filtering/slicing record batches - Update IcebergTableProvider and IcebergStaticTableProvider to pass limit parameter to scan - Add comprehensive tests for limit pushdown functionality ## Which issue does this PR close? - Closes #. ## What changes are included in this PR? ## Are these changes tested? Co-authored-by: Claude Sonnet 4.5 <[email protected]>
gbrgr
added a commit
to RelationalAI/iceberg-rust
that referenced
this pull request
Jan 9, 2026
#30) * Merge remote-tracking branch 'upstream/main' into gb/merge-upstream-arrow-57.1 * Fix merge mistakes * . * . * . * . * . * . * . * . * . * . * format * Disable python bindings again * Fix clippy errors * Enable tests * Fix merge mistake * . * . * . * Clippy fix * fix: Reserved sort order ID cannot contain any fields (apache#1978) ## Which issue does this PR close? - Closes apache#1963. ## What changes are included in this PR? This change validates that table metadata with reserved sort order ID (0) cannot contain fields associated with it. If this is found, we error out instead of silently parsing arbitrary field values. ## Are these changes tested? Added the unit test described in the issue and verified that the check is now enforced. * feat(datafusion): Add LIMIT pushdown support (apache#2006) Implement LIMIT pushdown to optimize queries with LIMIT clauses by stopping data processing once the limit is reached. This reduces unnecessary I/O and computation for queries that only need a subset of rows. Changes: - Add limit field to IcebergTableScan to track row limit - Apply limit at stream level by filtering/slicing record batches - Update IcebergTableProvider and IcebergStaticTableProvider to pass limit parameter to scan - Add comprehensive tests for limit pushdown functionality ## Which issue does this PR close? - Closes #. ## What changes are included in this PR? ## Are these changes tested? Co-authored-by: Claude Sonnet 4.5 <[email protected]> * Redo comment * Add case-sensitive attribute to incremental scan for consistency --------- Co-authored-by: Aditya Subrahmanyan <[email protected]> Co-authored-by: Liang-Chi Hsieh <[email protected]> Co-authored-by: Claude Sonnet 4.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement LIMIT pushdown to optimize queries with LIMIT clauses by stopping data processing once the limit is reached. This reduces unnecessary I/O and computation for queries that only need a subset of rows.
Changes:
Which issue does this PR close?
What changes are included in this PR?
Are these changes tested?