From 9d9e32bcbd9c317a86b04b0911e1d2405f8db970 Mon Sep 17 00:00:00 2001 From: Amogh Jahagirdar Date: Thu, 1 Aug 2024 12:27:33 -0700 Subject: [PATCH] Spec: Add RemovePartitionSpecsUpdate REST update type --- open-api/rest-catalog-open-api.py | 6 ++++++ open-api/rest-catalog-open-api.yaml | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/open-api/rest-catalog-open-api.py b/open-api/rest-catalog-open-api.py index 56212f1ac0b5..6a0912acc0a1 100644 --- a/open-api/rest-catalog-open-api.py +++ b/open-api/rest-catalog-open-api.py @@ -360,6 +360,11 @@ class RemovePartitionStatisticsUpdate(BaseUpdate): snapshot_id: int = Field(..., alias='snapshot-id') +class RemovePartitionSpecsUpdate(BaseUpdate): + action: Optional[Literal['remove-partition-specs']] = None + spec_ids: List[int] = Field(..., alias='spec-ids') + + class AssertCreate(BaseModel): """ The table must not already exist; used for create transactions @@ -1070,6 +1075,7 @@ class TableUpdate(BaseModel): RemovePropertiesUpdate, SetStatisticsUpdate, RemoveStatisticsUpdate, + RemovePartitionSpecsUpdate, ] diff --git a/open-api/rest-catalog-open-api.yaml b/open-api/rest-catalog-open-api.yaml index 661af11efc4b..5a87bf9254ee 100644 --- a/open-api/rest-catalog-open-api.yaml +++ b/open-api/rest-catalog-open-api.yaml @@ -2265,6 +2265,7 @@ components: remove-statistics: '#/components/schemas/RemoveStatisticsUpdate' set-partition-statistics: '#/components/schemas/SetPartitionStatisticsUpdate' remove-partition-statistics: '#/components/schemas/RemovePartitionStatisticsUpdate' + remove-partition-specs: '#/components/schemas/RemovePartitionSpecsUpdate' type: object required: - action @@ -2567,6 +2568,20 @@ components: type: integer format: int64 + RemovePartitionSpecsUpdate: + allOf: + - $ref: '#/components/schemas/BaseUpdate' + required: + - spec-ids + properties: + action: + type: string + enum: [ "remove-partition-specs" ] + spec-ids: + type: array + items: + type: integer + TableUpdate: anyOf: - $ref: '#/components/schemas/AssignUUIDUpdate' @@ -2586,6 +2601,7 @@ components: - $ref: '#/components/schemas/RemovePropertiesUpdate' - $ref: '#/components/schemas/SetStatisticsUpdate' - $ref: '#/components/schemas/RemoveStatisticsUpdate' + - $ref: '#/components/schemas/RemovePartitionSpecsUpdate' ViewUpdate: anyOf: