Skip to content

feat(sql): expose batch size to sql builder - #8648

Open
dentiny wants to merge 5 commits into
lance-format:mainfrom
dentiny:hjiang/expose-batch-size-sql
Open

feat(sql): expose batch size to sql builder#8648
dentiny wants to merge 5 commits into
lance-format:mainfrom
dentiny:hjiang/expose-batch-size-sql

Conversation

@dentiny

@dentiny dentiny commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Closes #8649

Hi team, I'm using a forked lance data viewer to view lance dataset.

One pain point is memory consumption for queries, streaming execution is sth I've been investigating.
Scanner exposes batch_size and batch_size_bytes, but SqlQueryBuilder does not. SQL queries therefore use DataFusion/Lance defaults, potentially producing large batches even when consumers incrementally poll the stream.

I'm wondering if we could expose equivalent options on SqlQueryBuilder and propagate them to both LanceTableProvider and DataFusion SessionConfig. This would let streaming consumers reduce peak and retained memory without limiting the total query result.

@github-actions github-actions Bot added A-python Python bindings enhancement New feature or request labels Aug 19, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Aug 20, 2026
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Aug 20, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Aug 20, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Aug 20, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gate recommendation: approve.

Shared scanner-boundary validation now rejects invalid row batch sizes before SQL or direct-provider execution, eliminating the prior zero-row data-loss path. Rust and Python regressions cover both bounds and the explicit byte-limit precedence.

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

Labels

A-python Python bindings enhancement New feature or request K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: expose query batch size to sql builder

1 participant