Repository navigation
feat(scan): add opt-in planning object limits - #592
realAaronWu wants to merge 1 commit into
Conversation
|
Could a maintainer approve the fork workflows for the revised head |
|
The change seems a little invasive for this feature. Could we first consider:
Could we evaluate these two approaches first before introducing broader changes to the planning APIs and executor? |
|
The patch now limits only opt-in
Our C++ regression uses pinned snapshot 2 without LIMIT. A data-column predicate prunes all output, yet an entry budget of five returns All 39 focused Linux x86-64 tests and the external C++17 probe passed on this revision. |
2043b9b to
5f78793
Compare
|
Hi @realAaronWu, introducing a new LIMIT semantic may lead to some behavioral differences, as mentioned in #588, we recommend adding a plan limit in your implementation to minimize changes to the original execution path. If you’re considering contribute a Java-like LIMIT pushdown to paimon-cpp we talk above, we’re very welcome that approach too. |
|
The current revision adds a separate, opt-in plan limit. On a pinned Avro snapshot without a SQL LIMIT, an entry budget of 5 returns This bounds planning object counts for the opt-in path. Decoder memory and broader byte accounting are outside its scope. A Java-style LIMIT optimization would be a separate change. When you recommend a plan limit, does this opt-in C++ API match what you had in mind, or would you prefer the limit to live entirely in the embedding code? |
Thanks for the quick reply! We suggest first landing this PR into your C++ integration code (e.g., via patch), while keeping an eye on the related issues. If there are similar needs, we can then reopen this PR and incorporate this part into paimon-cpp. |
|
Java-style LIMIT pushdown can stop reading manifests once enough live rows are found. We need a planning limit even for queries without a row LIMIT. In our regression, the predicate prunes every file, but planning still encounters six manifest entries. A budget of five returns Would you consider narrowing #592 to opt-in checks before creating manifest-list records, manifest entries, and packed splits, using the existing executor and task cleanup? |
|
I’m concerned about how invasive this change is to the existing scan pipeline. It adds branches and state across the public API, manifest reading, and scan planning for a fairly narrow use case, which could increase maintenance costs. Could we first follow Java Paimon’s approach and improve the existing LIMIT pushdown to avoid unnecessary manifest-entry and split materialization? If we also need separate planning resource limits, we could define their general semantics and scope before introducing them, keeping the API and implementation changes focused. LIMIT cannot fully solve the memory problem, but the proposed limits do not provide a complete memory guarantee either. |
Admit manifest-list records, manifest entries and packed splits before constructing them. Keep the existing parallel executor and accepted-task cleanup. Refs apache#435
5f78793 to
dbdca97
Compare
|
Thanks @lxy-9602 and @lucasfang. I’ve pushed the narrower revision in The counts also apply to full scans without a SQL LIMIT. Decoder allocations are outside their scope. The 40 focused Linux tests and the external C++17 check passed on these sources. Could you take another look at whether this narrower scope fits paimon-cpp? |
|
@lucasfang, Java-style LIMIT pushdown cannot meet our planning resource requirement. We need In our C++ regression, #592 is the smallest change we propose for that requirement. It checks three opt-in object counts before construction: manifest-list records, manifest entries, and packed splits. It reuses the existing executor and failure cleanup. Decoder memory needs separate accounting. |
Purpose
Refs #435.
Add opt-in object limits to full-snapshot batch planning for managed append-only tables using uncached Avro manifests. Base and delta tasks share the manifest-list allowance. Manifest reads share the entry allowance, and the scan checks the packed split count before constructing splits. Exceeding a configured count returns
CapacityErrorwithout publishing a plan.The scan uses the existing parallel executor and accepted-task cleanup. The counts apply before data-column pruning or SQL row-limit pushdown can reduce the result. Decoder buffers, variable-length values, and total memory require separate accounting.
Tests
Cover parallel allowance sharing, cumulative reads across many manifests, refusal before decoding an over-budget entry into an object, data-column pruning, packed split limits with and without a SQL row limit, and accepted-task cleanup. Retain regression coverage for the default scan and
ListFiles().API and Format
Adds the opt-in
TableScan::Create(context, PlanningLimits)overload. Unspecified counts are unlimited. The existing factory and storage format are unchanged.Documentation
The public header describes the supported scan profile, count boundaries, and allocations outside this API.
Generative AI tooling
Generated-by: OpenAI Codex (GPT-6)