[views] /v2 views API contract (review aid for #694, not for merge) - #702
Draft
ruolin59 wants to merge 1 commit into
Draft
[views] /v2 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
…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
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
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 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
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, 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 sharedErrorResponseBodyis untouched.Where the rest lives
Everything else is in #694 and is not duplicated here:
ViewApiContractTestViewsController,ViewsApiHandler/v2routes and their delegationOpenHouseViewsApiValidatorViewsService/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.