Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAPI: Add RemovePartitionSpecsUpdate REST update type #10846

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about remove-unused-partitioned-specs/remove-unused-specs, emphasizing the unused part?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, I'm neutral about the name, this name is more general and expresses the intention well.

Copy link
Contributor Author

@amogh-jahagirdar amogh-jahagirdar Aug 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think I would prefer to have the name be generic. While the update type would primarily be used for the RemoveUnusedSpecs option, I don't think that particular use case needs to be explicitly outlined in the name.

Copy link
Contributor

@aokolnychyi aokolnychyi Aug 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also go for a more generic name, would skip unused for now.

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