Hi Giuseppe, The plan looks good to me. Starting with a synchronous approach means we aren't prioritizing performance yet, which is fine for Phase 1. This is an intentional strategy to break a larger effort down into smaller, manageable steps.
Yufei On Wed, Dec 2, 2026 at 6:18 AM Giuseppe Vulduraro <[email protected]> wrote: > > Hi all, > > Thanks, Tornike and Yufei. I opened #6294 > <https://github.com/apache/polaris/issues/6294> to track phase 1. Before > the first PRs, I'd like to agree on a few design points. My proposals: > > 1. Module layout: a scan planning SPI plus one implementation module under > extensions/, like the metrics API (#4115 > <https://github.com/apache/polaris/pull/4115>), so downstream builds can > leave planning out. The endpoint methods stay in runtime/service, since > they come from the generated Iceberg API. > > 2. SPI shape: the planner returns file scan tasks and remaining work; > Polaris builds the REST response, including plan-id, plan tasks and vended > credentials. This keeps Polaris's own credentials out of the SPI, and a > delegation service could implement it later. > > 3. Authorization: new operations (e.g. PLAN_TABLE_SCAN, FETCH_SCAN_TASKS) > mapped to TABLE_READ_DATA, since the returned column stats expose data > values. Their names become part of the OPA contract. > > 4. Events: new BEFORE_/AFTER_ event types for the new endpoints, without > the filter expression, whose literals may be sensitive. > > 5. Flag: off by default, checked in the handler and in the /v1/config > advertisement. External and federated catalogs reject /plan with 406. > > 6. Plan tasks: one per manifest of the scanned snapshot, resolved through > the table's own metadata after re-authorizing, so any instance can serve > /tasks without stored state. > > Do these look reasonable? I'd especially appreciate feedback on 2 and 3, > since the SPI and the operation names are the hardest to change later. > Meanwhile I'll start on the first PR (spec and generated clients), which > doesn't depend on these choices. > > Thanks, > Giuseppe > > Il giorno mar 1 dic 2026 alle ore 18:28 Yufei Gu <[email protected]> ha > scritto: > > > Hi Giuseppe, +1 on the scan planning phase 1. Thanks for picking it up! > > Yufei > > > > > > On Tue, Dec 1, 2026 at 9:22 AM Tornike Gurgenidze <[email protected]> > > wrote: > > > > > Hi Giuseppe, > > > > > > I haven't started on it, no. Feel free to take it up. ping me on gh, I > > can > > > help review as much as I can. > > > > > > Thanks, > > > Tornike > > > > > > On Tue, Dec 1, 2026 at 5:52 PM Giuseppe <[email protected]> > > > wrote: > > > > > > > Hi Tornike, all, > > > > > > > > Is phase 1 still on your plan? If you don't have time for it, I'd like > > > > to implement phase 1a. If you're already working on it, I'm happy to > > > > help on your branch instead. > > > > > > > > A few notes on phase 1a after re-reading the doc and the thread: > > > > > > > > - Iceberg 1.12, which Polaris already uses, ships server-side handlers > > > > for all four operations (CatalogHandlers.planTableScan etc.). Their > > plan > > > > state is an in-memory map per JVM with no notion of the caller, so we > > > > can reuse their planning logic but not their state. > > > > - Prashant's one-plan-task-per-manifest idea fits well: if a plan task > > > > just identifies a manifest of the scanned snapshot, any instance can > > > > serve /tasks without stored state. The server only has to check that > > the > > > > manifest belongs to the table. > > > > - Agreed that the planner interface should let a delegation service > > > > return the same results later. I'd settle the details in the PRs. > > > > > > > > I'd split phase 1a into small PRs: > > > > > > > > 1. Spec, generated clients and a feature flag, off by default. > > > > 2. The synchronous endpoint with the authorization operations from your > > > > doc (RBAC, Ranger, OPA). > > > > 3. /v1/config advertising it only when enabled, plus Spark regression > > > > tests (scan-planning-mode=server). > > > > > > > > For phase 1b, building on Prashant's plan-id point, I could write a > > > > short proposal for plan ownership: a plan is bound to the principal > > that > > > > created it, and any other caller gets the same response as for an > > > > unknown plan-id. > > > > > > > > Let me know what you think. > > > > > > > > Thanks, > > > > Giuseppe > > > > > > > > On 6/22/2026 9:00 PM, Prashant Singh wrote: > > > > > Hi Tornike, > > > > > > > > > > Thanks for putting this proposal together. It makes sense to tackle > > > this > > > > > problem with an incremental approach, especially since it's an opt-in > > > > > feature, default disabled. > > > > > > > > > > However, there are a few specific areas I’d like to discuss further > > > > before > > > > > we finalize the direction: > > > > > > > > > > - > > > > > > > > > > *Authorization and plan-id Leakage:* If the plan-id is included > > in > > > > the > > > > > query parameters, it will inevitably be logged. My concern is > > > > whether User > > > > > B could fetch tasks using User A's plan-id if they manage to > > access > > > > > those logs. Relying solely on table-level access for > > authorization > > > > might > > > > > not be sufficient to prevent this; we likely need stricter access > > > > controls > > > > > tied to the plan itself. > > > > > - > > > > > > > > > > *Modeling the Planner and Delegation Interface:* Because the > > > > interface > > > > > for the delegation service isn't finalized yet, we need to ensure > > > > it's > > > > > defined in a way that allows it to seamlessly provide the same > > > > information > > > > > as the local service. I realize this starts to cross over into > > > > Low-Level > > > > > Design (LLD), so I'm perfectly fine with hashing out the exact > > > > > implementation details during the PR review process. > > > > > - > > > > > > > > > > *Tasks Endpoint Optimization (Without Delegation):* We should > > look > > > > into > > > > > modeling each planTask to correspond to a specific manifest. Even > > > > though > > > > > we would have to open the manifest list more than once, it would > > > > reduce the > > > > > memory footprint overall. Eric, Yufei, and I have discussed this > > in > > > > the > > > > > past, so I’d love to get your thoughts on incorporating it here. > > > > > > > > > > Looking forward to it. > > > > > > > > > > Best regards, > > > > > > > > > > Prashant Singh > > > > > > > > >
