Skip to content

[views] /v2 views API contract (review aid for #694, not for merge) - #702

Draft
ruolin59 wants to merge 1 commit into
linkedin:mainfrom
ruolin59:rufan-linkedin-views-api-contract-only
Draft

[views] /v2 views API contract (review aid for #694, not for merge)#702
ruolin59 wants to merge 1 commit into
linkedin:mainfrom
ruolin59:rufan-linkedin-views-api-contract-only

Conversation

@ruolin59

@ruolin59 ruolin59 commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Important

This PR is a reading aid, not a merge candidate. #694 is the change under review and the one that would merge. This branch reproduces only the wire models from it, with nothing else, so the API contract can be read without the surrounding implementation. Please leave review comments on #694 unless they're specifically about the shape of these five files.

Extracted from #694 in response to the feedback that 5k lines gets a shallow review. 273 lines across five files, no tests, no wiring, nothing called by anything.

The contract

CreateUpdateViewRequestBodyviewId, databaseId, clusterId, schema, representations, sourceDialect, defaultCatalog, defaultNamespace, viewProperties, baseViewVersion. representations is a list of ViewRepresentation {type, sql, dialect} rather than a scalar sql field, so a second dialect can be added later without changing the shape.

GetViewResponseBody — the pointer and row-backed identity. SQL, schema and history stay in the Iceberg metadata file, which the client already reads through its own FileIO.

GetAllViewsResponseBody — paginated from the first release, reusing GetViewResponseBody for its elements populated with identifiers only, matching how the v2 table search behaves.

ViewErrorCode — all fourteen failure modes declared now, including the ones M1 never emits, so later milestones add behaviour without changing the enum. It selects an HTTP status and is never serialized; the shared ErrorResponseBody is untouched.

Where the rest lives

Everything else is in #694 and is not duplicated here:

ViewApiContractTest freezes every field set and JSON key set above
ViewsController, ViewsApiHandler the five /v2 routes and their delegation
OpenHouseViewsApiValidator structural validation
ViewsService / ViewsDisabledService the stubbed service seam
ViewDto, ViewsMapper internal model and mapping

For context on why the contract is shaped this way rather than following the Iceberg REST spec, see the feasibility comparison and the discussion on #694.

…merge)

Extracted from linkedin#694 so the wire contract can be read on its own. This
branch is a reading aid: linkedin#694 remains the change under review and the one
that would merge. Tests, controller, handler, validator and service seam
are all in linkedin#694; only the models are reproduced here.

  CreateUpdateViewRequestBody carries viewId, databaseId, clusterId,
  schema, representations, sourceDialect, defaultCatalog,
  defaultNamespace, viewProperties and baseViewVersion. representations
  is a list of ViewRepresentation {type, sql, dialect} rather than a
  scalar sql field, so a second dialect can be added later without
  changing the shape.

  GetViewResponseBody carries the pointer and row-backed identity only.
  SQL, schema and history stay in the Iceberg metadata file, which the
  client already reads through its own FileIO.

  GetAllViewsResponseBody is paginated from the first release and reuses
  GetViewResponseBody for its elements, populated with identifiers only,
  matching how the v2 table search behaves.

  ViewErrorCode declares all fourteen failure modes now, including the
  ones this milestone never emits, so later work adds behaviour without
  changing the enum. It selects an HTTP status and is never serialized;
  the shared error body is untouched.

273 lines across five files.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@ruolin59
ruolin59 force-pushed the rufan-linkedin-views-api-contract-only branch from 695133c to ce637f5 Compare August 28, 2026 23:00
@ruolin59 ruolin59 changed the title [views] Add the /v2 views API contract and freeze it [views] /v2 views API contract (review aid for #694, not for merge) Aug 28, 2026
@ruolin59
ruolin59 marked this pull request as draft August 28, 2026 23:01
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