본문으로 건너뛰기

SP4 Polish 2 — materialize an operation tree as a new cohort_definition + cohort table rows in the source's cohort schema.

POST 

/api/v1/finngen/workbench/materialize

Flow:

  1. Validate the tree structurally (CohortOperationCompiler).
  2. Create the cohort_definition row in app.cohort_definitions owned by the caller; store the operation tree under expression_json so the definition round-trips.
  3. Compile the tree to a subject-id SELECT fragment + collect the referenced cohort IDs (needed for the INSERT that joins back to cohort for start/end dates).
  4. Dispatch a cohort.materialize Run; caller polls /runs/{id}.

Returns 202 with the Run record + the new cohort_definition_id so the UI can wire the Handoff step to the freshly materialized cohort.

Request

Responses