c-thiel commented on code in PR #12584:
URL: https://github.com/apache/iceberg/pull/12584#discussion_r3369202513
##########
open-api/rest-catalog-open-api.py:
##########
@@ -1626,6 +1742,113 @@ class CommitTableResponse(BaseModel):
metadata: TableMetadata
+class QueryEventsResponse(BaseModel):
+ continuation_token: str = Field(
+ ...,
+ alias='continuation-token',
+ description="An opaque continuation token to fetch the next page of
events. This token encodes the server's cursor position and filter state.
Clients should treat this as an opaque value and pass it unmodified in
subsequent requests. When no more events are currently available, the server
returns an empty `events` array and a `continuation-token` that the client can
re-issue later to receive events that occur after this point.\n",
+ )
+ events: list[Event]
+
+
+class Event(BaseModel):
+ event_id: str = Field(
+ ...,
+ alias='event-id',
+ description='Unique ID of this event. Clients should perform
deduplication based on this ID.',
+ )
+ request_id: str = Field(
+ ...,
+ alias='request-id',
+ description='Opaque ID of the request this change belongs to. This ID
can be used to identify events that were part of the same request.\n',
+ )
+ request_event_count: int = Field(
+ ...,
+ alias='request-event-count',
+ description='Number of events produced by the originating catalog
request (e.g. updateTable or commitTransaction) that generated this event. Such
requests can apply multiple updates atomically, each surfaced as a separate
event sharing the same `request-id`; this count reports how many events that
originating request produced in total.\n',
+ )
+ timestamp_ms: int = Field(
+ ...,
+ alias='timestamp-ms',
+ description='Timestamp when this event occurred (epoch milliseconds).
Timestamps are not guaranteed to be unique. Typically all events in a
transaction will have the same timestamp.\n',
+ )
+ actor: Actor | None = Field(
+ None,
+ description='The actor who performed the operation, such as a user or
service account. Implementations may add arbitrary additional fields; the
optional `id` field is recommended as a portable identifier that consumers can
render and key on.\n',
+ )
+ operation: (
+ CreateTableOperation
+ | RegisterTableOperation
+ | DropTableOperation
+ | UpdateTableOperation
+ | RenameTableOperation
+ | CreateViewOperation
+ | DropViewOperation
+ | UpdateViewOperation
+ | RenameViewOperation
+ | CreateNamespaceOperation
+ | UpdateNamespacePropertiesOperation
+ | DropNamespaceOperation
+ ) = Field(
+ ...,
+ description='The operation that was performed, such as creating or
updating a table. The concrete type is selected by the `operation-type`
discriminator defined on `BaseOperation`. Clients should discard events with
unknown operation types. Operations are emitted only when the underlying change
is committed; staged changes are not surfaced.\n',
+ )
+
+
+class CreateTableOperation(BaseOperation):
Review Comment:
This file is generated by `datamodel-code-generator` (the
`open-api/Makefile` generate target) — it's not hand-written, so the layout
isn't something we curate. The generator emits classes in topological
dependency order (each class after the types it references), which is why the
`BaseOperation` subclasses end up next to their dependencies rather than
grouped together — e.g. `CreateTableOperation` sits near `TableUpdate`, while
`DropTableOperation` lands much earlier. In the source
`rest-catalog-open-api.yaml` the operations are all defined contiguously under
`BaseOperation`. We'd have to post-process the generated output to regroup
them, which we don't do for any other schemas, so I'd leave it as-is.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]