[views] /v1 views API contract (review aid for #694, not for merge) - #702
Draft
ruolin59 wants to merge 1 commit into
Draft
[views] /v1 views API contract (review aid for #694, not for merge)#702ruolin59 wants to merge 1 commit into
ruolin59 wants to merge 1 commit into
Conversation
ruolin59
force-pushed
the
rufan-linkedin-views-api-contract-only
branch
from
August 28, 2026 23:00
695133c to
ce637f5
Compare
ruolin59
marked this pull request as draft
August 28, 2026 23:01
ruolin59
force-pushed
the
rufan-linkedin-views-api-contract-only
branch
from
September 1, 2026 23:10
ce637f5 to
86dfc9e
Compare
…merge) Extracted from linkedin#694 so the wire contract and endpoint surface can be read on their own. This branch is a reading aid: linkedin#694 remains the change under review and the one that would merge. Only the API definition is reproduced here; the validator, service seam, mappers, audit redaction and the full test suite all stay in linkedin#694. ViewsController exposes the five routes under /v1/databases/{databaseId}/views: POST (201), GET item (200), PUT (200 or 201), GET collection (200, paginated), DELETE (204), with the status codes and view privileges each declares. ViewsApiHandler is the interface the controller delegates to, kept here so the endpoint-to-handler contract is legible. 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. Views only ever expose a paginated list. 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. Privileges gains CREATE_VIEW, LIST_VIEW, UPDATE_VIEW_METADATA and DELETE_VIEW; single-view reads reuse SELECT. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ruolin59
force-pushed
the
rufan-linkedin-views-api-contract-only
branch
from
September 9, 2026 20:43
86dfc9e to
35caf18
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 API definition from it — the endpoints and the wire models — so the surface can be read without the surrounding implementation. Please leave review comments on #694 unless they're specifically about the shape of these files.
Extracted from #694 in response to the feedback that 5k lines gets a shallow review. 573 lines across eight files, no validator, no service logic, no test suite.
The endpoints
ViewsController— the five routes under/v1/databases/{databaseId}/views:/viewsCREATE_VIEW/views/{viewId}SELECT/views/{viewId}UPDATE_VIEW_METADATA/viewsLIST_VIEW/views/{viewId}DELETE_VIEWViewsApiHandler— the interface the controller delegates to, included so the endpoint-to-handler contract is legible.The wire models
CreateUpdateViewRequestBody—viewId,databaseId,clusterId,schema,representations,sourceDialect,defaultCatalog,defaultNamespace,viewProperties,baseViewVersion.representationsis a list ofViewRepresentation {type, sql, dialect}rather than a scalarsqlfield, 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 ownFileIO.GetAllViewsResponseBody— paginated from the first release, reusingGetViewResponseBodyfor its elements populated with identifiers only. Views only ever expose a paginated list.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 sharedErrorResponseBodyis untouched.PrivilegesgainsCREATE_VIEW,LIST_VIEW,UPDATE_VIEW_METADATA,DELETE_VIEW; single-view reads reuseSELECT.Where the rest lives
Everything else is in #694 and is not duplicated here:
ViewApiContractTestOpenHouseViewsApiHandlerOpenHouseViewsApiValidatorViewsService/ViewsDisabledServiceViewDto,ViewsMapperFor 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.