adnanhemani commented on code in PR #12584:
URL: https://github.com/apache/iceberg/pull/12584#discussion_r3365780866


##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -3708,6 +3778,74 @@ components:
       allOf:
         - $ref: '#/components/schemas/ScanTasks'
 
+    QueryEventsRequest:
+      type: object
+      properties:
+        continuation-token:
+          type: string
+          description: >
+            A continuation token returned by a previous response. Clients 
should treat the
+            token as an opaque value and pass it unmodified. If not provided, 
events are
+            returned from the beginning of the event log subject to other 
filters.
+        page-size:
+          type: integer
+          format: int32
+          minimum: 1
+          description: >
+            The maximum number of events to return in a single response.
+            If not provided, the server may choose a default page size.
+            Servers may return less results than requested for various 
reasons, such as
+            server side limits, payload size or processing time.
+        since-timestamp-ms:
+          type: integer
+          format: int64
+          description: >
+            Optional starting timestamp (seek-to-timestamp) for the initial 
request, in
+            milliseconds (inclusive). Lets clients begin consumption from a 
rough point in time
+            without iterating the full history. If not provided, no filtering 
based on timestamp
+            values is applied.
+        operation-types:
+          type: array
+          items:
+            $ref: "#/components/schemas/OperationType"
+          description: >
+            Filter events by the type of operation.
+            If not provided, all types are returned.
+        catalog-objects-by-name:
+          type: array
+          items:
+            $ref: "#/components/schemas/CatalogObjectIdentifier"

Review Comment:
   Question here - my understanding is that CatalogObjectIdentifier is a simple 
array of strings. So how do we know that this array of strings leads to a 
namespace or table-like entity, given that we could have a multi-level 
namespace?



##########
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:
   nit: why aren't all the classes that are inheriting from BaseOperation 
together in the file versus separated across the whole file?



##########
open-api/rest-catalog-open-api.py:
##########
@@ -1873,6 +2096,13 @@ class PlanTableScanResult(
 CreateTableRequest.model_rebuild()
 CreateViewRequest.model_rebuild()
 ScanReport.model_rebuild()
+QueryEventsResponse.model_rebuild()
+Event.model_rebuild()
+CreateTableOperation.model_rebuild()
+RegisterTableOperation.model_rebuild()
+UpdateTableOperation.model_rebuild()
+CreateViewOperation.model_rebuild()
+UpdateViewOperation.model_rebuild()

Review Comment:
   Sorry I'm not super familiar with this, but is there a reason why certain 
classes are listed here but others aren't?



##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -3708,6 +3778,74 @@ components:
       allOf:
         - $ref: '#/components/schemas/ScanTasks'
 
+    QueryEventsRequest:
+      type: object
+      properties:
+        continuation-token:

Review Comment:
   Can we also detail what happens if both a `continuation-token` and 
`since-timestamp-ms` are defined?



-- 
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]

Reply via email to