Skip to content
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
24 changes: 24 additions & 0 deletions open-api/rest-catalog-open-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ class RemoveStatisticsUpdate(BaseUpdate):
snapshot_id: int = Field(..., alias='snapshot-id')


class RemovePartitionStatisticsUpdate(BaseUpdate):
action: Literal['remove-partition-statistics']
snapshot_id: int = Field(..., alias='snapshot-id')


class TableRequirement(BaseModel):
type: str

Expand Down Expand Up @@ -618,6 +623,12 @@ class BlobMetadata(BaseModel):
properties: Optional[Dict[str, Any]] = None


class PartitionStatisticsFile(BaseModel):
snapshot_id: int = Field(..., alias='snapshot-id')
statistics_path: str = Field(..., alias='statistics-path')
file_size_in_bytes: int = Field(..., alias='file-size-in-bytes')


class CreateNamespaceRequest(BaseModel):
namespace: Namespace
properties: Optional[Dict[str, str]] = Field(
Expand All @@ -638,6 +649,13 @@ class TransformTerm(BaseModel):
term: Reference


class SetPartitionStatisticsUpdate(BaseUpdate):
action: Literal['set-partition-statistics']
partition_statistics: PartitionStatisticsFile = Field(
..., alias='partition-statistics'
)


class ReportMetricsRequest2(CommitReport):
report_type: str = Field(..., alias='report-type')

Expand Down Expand Up @@ -754,6 +772,12 @@ class TableMetadata(BaseModel):
last_sequence_number: Optional[int] = Field(None, alias='last-sequence-number')
snapshot_log: Optional[SnapshotLog] = Field(None, alias='snapshot-log')
metadata_log: Optional[MetadataLog] = Field(None, alias='metadata-log')
statistics_files: Optional[List[StatisticsFile]] = Field(
None, alias='statistics-files'
)
partition_statistics_files: Optional[List[PartitionStatisticsFile]] = Field(
None, alias='partition-statistics-files'
)


class ViewMetadata(BaseModel):
Expand Down
54 changes: 54 additions & 0 deletions open-api/rest-catalog-open-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2058,6 +2058,15 @@ components:
$ref: '#/components/schemas/SnapshotLog'
metadata-log:
$ref: '#/components/schemas/MetadataLog'
# statistics
statistics-files:
type: array
items:
$ref: '#/components/schemas/StatisticsFile'
partition-statistics-files:
type: array
items:
$ref: '#/components/schemas/PartitionStatisticsFile'

SQLViewRepresentation:
type: object
Expand Down Expand Up @@ -2181,6 +2190,8 @@ components:
set-current-view-version: '#/components/schemas/SetCurrentViewVersionUpdate'
set-statistics: '#/components/schemas/SetStatisticsUpdate'
remove-statistics: '#/components/schemas/RemoveStatisticsUpdate'
set-partition-statistics: '#/components/schemas/SetPartitionStatisticsUpdate'
remove-partition-statistics: '#/components/schemas/RemovePartitionStatisticsUpdate'
type: object
required:
- action
Expand Down Expand Up @@ -2456,6 +2467,33 @@ components:
type: integer
format: int64

SetPartitionStatisticsUpdate:
allOf:
- $ref: '#/components/schemas/BaseUpdate'
required:
- action
- partition-statistics
properties:
action:
type: string
enum: [ "set-partition-statistics" ]
partition-statistics:
$ref: '#/components/schemas/PartitionStatisticsFile'

RemovePartitionStatisticsUpdate:
allOf:
- $ref: '#/components/schemas/BaseUpdate'
required:
- action
- snapshot-id
properties:
action:
type: string
enum: [ "remove-partition-statistics" ]
snapshot-id:
type: integer
format: int64

TableUpdate:
anyOf:
- $ref: '#/components/schemas/AssignUUIDUpdate'
Expand Down Expand Up @@ -3270,6 +3308,22 @@ components:
properties:
type: object

PartitionStatisticsFile:
type: object
required:
- snapshot-id
- statistics-path
- file-size-in-bytes
properties:
snapshot-id:
type: integer
format: int64
statistics-path:
type: string
file-size-in-bytes:
type: integer
format: int64


#############################
# Reusable Response Objects #
Expand Down