Skip to content

Commit

Permalink
Spec: Add RemovePartitionSpecsUpdate REST update type
Browse files Browse the repository at this point in the history
  • Loading branch information
amogh-jahagirdar committed Aug 2, 2024
1 parent 4a0ae22 commit 9d9e32b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions open-api/rest-catalog-open-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1070,6 +1075,7 @@ class TableUpdate(BaseModel):
RemovePropertiesUpdate,
SetStatisticsUpdate,
RemoveStatisticsUpdate,
RemovePartitionSpecsUpdate,
]


Expand Down
16 changes: 16 additions & 0 deletions open-api/rest-catalog-open-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand All @@ -2586,6 +2601,7 @@ components:
- $ref: '#/components/schemas/RemovePropertiesUpdate'
- $ref: '#/components/schemas/SetStatisticsUpdate'
- $ref: '#/components/schemas/RemoveStatisticsUpdate'
- $ref: '#/components/schemas/RemovePartitionSpecsUpdate'

ViewUpdate:
anyOf:
Expand Down

0 comments on commit 9d9e32b

Please sign in to comment.