Hi JB, all, Thanks for the detailed review, this helps a lot.
I opened the first PR: https://github.com/apache/polaris/pull/6332 (spec and generated API). I'll fold JB's suggestions into the next PRs: - modules and SPI: no planner on the classpath behaves like the flag being off; Polaris owns the plan task envelope and hands the planner a prepared FileIO - planTableScan: PLAN_TABLE_SCAN and FETCH_SCAN_TASKS (OPA and Ranger), events limited to identifiers and counts - flag: a FeatureConfiguration with a catalog-level override; I'll call out the CatalogConfigEndpointContributor change in that PR - /tasks: plan tasks treated as untrusted, manifests by position, bound to the table UUID, no signing in 1a Unless there are objections, I'll proceed on that basis. Thanks, Giuseppe On Thu, Dec 3, 2026 at 4:04 PM Jean-Baptiste Onofré <[email protected]> wrote: > Hi Giuseppe, > > Thanks for picking up as discussed on Slack :) > > Overall it looks good to me. > > A few comments our your points: > > 1. +1 on the module layout. Following the metrics-reports layout > (api/spi/base) matches what Dmitri suggested. One thing to decide > early: what runtime/service does when no planner implementation is on > the classpath. I would expect it to behave exactly like the flag being > off: 406 on the endpoints, and nothing in /v1/config. > > 2. +1 on Polaris owning the REST response, the plan-id and the > credentials. I have two suggestions: > - Let Polaris own the plan task envelope as well. The planner returns > its remaining work as an opaque payload. Polaris wraps it with the > table UUID, the snapshot id and a format version. On /tasks, Polaris > re-authorizes and checks the envelope before handing the payload back > to the planner. That keeps the check in one place, whether the planner > is local or a delegation service later. The version lets us change the > format later without breaking scans that are in flight during a > rolling upgrade. > - Be explicit about how the local planner reads manifests. I would > pass it a FileIO (or the loaded Table) prepared by Polaris, so that > "no Polaris credentials in the SPI" also holds on the input side. > > 3. +1 on TABLE_READ_DATA. It is consistent with > LOAD_TABLE_WITH_READ_DELEGATION and REPORT_READ_METRICS, and it is > needed even without credential vending, because the response exposes > column bounds. One operation per endpoint is enough: unlike loadTable, > there is no write delegation to fall back from. On naming, these names > become part of the OPA contract and also need entries in the Ranger > semantics, so I would reuse the Iceberg operationIds: PLAN_TABLE_SCAN > and FETCH_SCAN_TASKS now, and FETCH_PLANNING_RESULT and > CANCEL_PLANNING in phase 1b. Then nobody has to guess the mapping. I > would add the 1b operations only when they are implemented, together > with the ownership rules. > > 4. +1 about events. The same applies to the /tasks events: if the plan > task carries the filter, the plan task string is as sensitive as the > filter. I would also keep the AFTER_ events to identifiers and counts > rather than the response body, since the response contains vended > crendentials and column bounds. > > 5. +1 to have the flag off by default. I would make it a > FeatureConfiguration with a catalog-level override (like > ALLOW_EXTERNAL_CATALOG_CREDENTIAL_VENDING), so an operator can enable > it on one catalog first. That affects /v1/config: > CatalogConfigEndpointContributor.endpoints() has no catalog argument > today. Advertising the endpoints per catalog (and not for external and > federated catalogs, which return 406) therefore needs a small change > to that interface. Please call that out explicitly in the PR. And yes, > 406 is the right code: the spec defines it for unsupported operations. > > 6. +1 on stateless plan tasks. FetchScanTasksRequest only carries the > plan task string, so the plan task has to carry the whole scan context > (snapshot id, filter, projection, case sensitivity, stats fields, > ...), not just the manifest. It is client input, so I would treat it > as untrusted: > - Refer to the manifest by its position in the snapshot's manifest > list rather than by its path. Membership is then implicit, and the > server never opens a location supplied by the client. > - Bind the plan task to the table UUID, and reject it if it is sent to > another table's /tasks path. > With re-authorization plus these checks, a tampered plan task gives > the caller nothing they could not get from /plan directly. So I don't > think we need to sign plan tasks in 1a, which also avoids key > management. That changes in 1b, when plans get an owner. > > One cost to to keep in mind: each /tasks response must include every > delete file referenced by its file scan tasks, so each call needs the > snapshot's delete index I think. On merge-on-read tables with many > delete manifests, that means re-reading the delete manifests on every > /tasks call. That's fine for 1a, and it's good first target for the > catching layer in phase 2. > > On Prashant's plan-id concern, in 1a, a plan-id is just an identifier. > The spec requires it on a completed response, but it carries no state > and grants no access, so the leakage concern doesn't apply yet I > guess. loadCredentials already accepts a planId parameter and ignores > it. I would keep it that way until the 1b proposal defines plan > ownership. > > Happy to review the PRs :) > > Regards > JB >
