snazy commented on code in PR #12584: URL: https://github.com/apache/iceberg/pull/12584#discussion_r2109196548
########## open-api/rest-catalog-open-api.yaml: ########## @@ -3405,6 +3488,131 @@ components: allOf: - $ref: '#/components/schemas/ScanTasks' + Actor: + type: object + description: Represents an actor that performed operations in the catalog + required: + - type + - actor-id + properties: + type: + type: string + description: The type of actor (e.g., "user", "principal", "role") + actor-id: + type: string + description: The identifier of the actor + metadata: + type: object + description: Additional metadata about the actor that may vary between implementations + additionalProperties: + type: string + example: + type: "role" + actor-id: "1234" + metadata: + permissions: "read-write" + expiration: "2025-06-07T12:00:00Z" + name: "Admin Role" + assumed-by: + type: "user" + actor-id: "4567" + metadata: + name: "Peter Cold" + email: "pe...@example.com" + + GetEventsRequest: + type: object + properties: + next-page-token: + $ref: "#/components/schemas/PageToken" + page-size: + type: integer + format: int32 + description: > + The maximum number of events to return in a single response. + If not provided, the server may choose a default page size. + after-timestamp-ms: + type: integer + format: int64 + description: > + The (server) timestamp in milliseconds to start consuming events from (inclusive). + If not provided, the first available timestamp is used. Review Comment: Wall clock can go backwards and forwards and also suddenly jump. It's also not consistent across different server instances. What you could do here is to define an _opaque_ token, that a particular service can deal with - the content/meaning however is up to the implementation. Just mentioning as a hint. ########## open-api/rest-catalog-open-api.yaml: ########## @@ -3964,6 +4172,302 @@ components: metadata: $ref: '#/components/schemas/TableMetadata' + EventsResponse: + type: object + required: + - highest-processed-timestamp-ms + - events + properties: + next-page-token: + $ref: "#/components/schemas/PageToken" + highest-processed-timestamp-ms: + description: > + The highest timestamp processed by the server when generating this response. + This may not necessarily appear in the returned changes if it was filtered out. + + Clients can use this value as the `after-timestamp-ms` parameter in subsequent + requests to continue retrieving changes after this point. + type: integer + format: int64 + events: + type: array + items: + $ref: "#/components/schemas/Event" + + Event: + type: object + required: + - event-id + - request-id + - event-count + - timestamp-ms + - operation + properties: + event-id: + type: string + description: Unique ID of this event. Clients should perform deduplication based on this ID. + request-id: + description: ID of the request this change belongs to. + type: string + event-count: + type: integer + description: Number of events in the request / batch of events + timestamp-ms: + type: integer + format: int64 + description: > + Timestamp when this transaction occurred (epoch milliseconds). + Timestamps are not guaranteed to be unique. Typically all events in + a transaction will have the same timestamp. + actor-chain: + type: array + items: + $ref: "#/components/schemas/Actor" + description: > + An ordered list of actors involved in the operation, with the most direct actor + (the one who actually performed the operation) first, followed by delegating actors + in order. For example, if a service account (actor[0]) performed an operation + on behalf of a role (actor[1]) assumed by a user (actor[2]), the chain represents + this delegation path. + operation: + type: object + discriminator: + propertyName: operation-type + mapping: + create-table: "#/components/schemas/CreateTableOperation" + register-table: "#/components/schemas/RegisterTableOperation" + drop-table: "#/components/schemas/DropTableOperation" + update-table: "#/components/schemas/UpdateTableOperation" + rename-table: "#/components/schemas/RenameTableOperation" + create-view: "#/components/schemas/CreateViewOperation" + drop-view: "#/components/schemas/DropViewOperation" + replace-view: "#/components/schemas/ReplaceViewOperation" + rename-view: "#/components/schemas/RenameTableOperation" + create-namespace: "#/components/schemas/CreateNamespaceOperation" + update-namespace-properties: "#/components/schemas/UpdateNamespacePropertiesOperation" + drop-namespace: "#/components/schemas/DropNamespaceOperation" + custom: "#/components/schemas/CustomOperation" + oneOf: + - $ref: "#/components/schemas/CreateTableOperation" + - $ref: "#/components/schemas/RegisterTableOperation" + - $ref: "#/components/schemas/DropTableOperation" + - $ref: "#/components/schemas/UpdateTableOperation" + - $ref: "#/components/schemas/RenameTableOperation" + - $ref: "#/components/schemas/CreateViewOperation" + - $ref: "#/components/schemas/DropViewOperation" + - $ref: "#/components/schemas/ReplaceViewOperation" + - $ref: "#/components/schemas/RenameTableOperation" + - $ref: "#/components/schemas/CreateNamespaceOperation" + - $ref: "#/components/schemas/UpdateNamespacePropertiesOperation" + - $ref: "#/components/schemas/DropNamespaceOperation" + - $ref: "#/components/schemas/CustomOperation" + + CreateTableOperation: + required: + - operation-type + - identifier + - table-uuid + - metadata + properties: + operation-type: + $ref: "#/components/schemas/OperationType" + const: "create-table" + identifier: + $ref: "#/components/schemas/TableIdentifier" + table-uuid: + type: string + format: uuid + metadata: + $ref: "#/components/schemas/TableMetadata" + + RegisterTableOperation: + required: + - operation-type + - identifier + - table-uuid + - metadata + properties: + operation-type: + $ref: "#/components/schemas/OperationType" + const: "register-table" + identifier: + $ref: "#/components/schemas/TableIdentifier" + table-uuid: + type: string + format: uuid + metadata: + $ref: "#/components/schemas/TableMetadata" + + DropTableOperation: + required: + - operation-type + - identifier + - table-uuid + properties: + operation-type: + $ref: "#/components/schemas/OperationType" + const: "drop-table" + identifier: + $ref: "#/components/schemas/TableIdentifier" + table-uuid: + type: string + format: uuid + purge: + type: boolean + description: Whether purge flag was set + + UpdateTableOperation: + required: + - operation-type + - identifier + - table-uuid + - updates + properties: + operation-type: + $ref: "#/components/schemas/OperationType" + const: "update-table" + identifier: + $ref: "#/components/schemas/TableIdentifier" + table-uuid: + type: string + format: uuid + updates: + type: array + items: + $ref: "#/components/schemas/TableUpdate" + + RenameTableOperation: Review Comment: SHouldn't this contain the "from" and "to" identifiers? ########## open-api/rest-catalog-open-api.yaml: ########## @@ -3041,6 +3096,34 @@ components: - $ref: '#/components/schemas/AddViewVersionUpdate' - $ref: '#/components/schemas/SetCurrentViewVersionUpdate' + OperationType: + type: string + description: > + Defines the type of operation, either a standard operation defined by the Iceberg REST API + specification or a custom operation specific to an implementation. + anyOf: + - enum: + - create-table Review Comment: I think I get @nastra's idea here. It's however a stretch between being too generic and too specific. No immediate idea though :shrug: -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org