Skip to content

sources: bound []map API batches by MaxBatchBytes (drop-in, 1/3) - #1095

Open
iremcaginyurtturk wants to merge 1 commit into
mainfrom
iremcaginyurtturk/byte-limit-dropin-sources
Open

sources: bound []map API batches by MaxBatchBytes (drop-in, 1/3)#1095
iremcaginyurtturk wants to merge 1 commit into
mainfrom
iremcaginyurtturk/byte-limit-dropin-sources

Conversation

@iremcaginyurtturk

@iremcaginyurtturk iremcaginyurtturk commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Adds a byte-based batch cap (MaxBatchBytes, from --batch-size, default 512 MiB) to 23 []map API sources whose read loops already flushed by row count. Drop-in: with the cap off, batches are byte-identical to before; with it on, the batch is flushed before a row would exceed the cap. Also flush-and-stop exactly at --limit in blobstore and stripe.

Prevents wide-row sources from accumulating an unbounded in-memory Arrow batch. Grouping is invisible downstream (rows keep order; destination concatenates batches).

1 of 3 independent PRs (drop-in / per-page+fast-path / whole-set), each off main.

Add a byte-based flush to 23 []map API sources whose read loops already
accumulated rows and flushed by count. The MaxBatchBytes check is a
drop-in: with the cap off the emitted batches are byte-identical to
before; with it on, the accumulated batch is flushed before appending a
row that would push it past the cap.

Also flush-and-stop exactly at --limit in blobstore and stripe.
@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "sources: bound []map API batches by MaxB..." | Re-trigger Greptile

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