This is an automated email from the ASF dual-hosted git repository.
etudenhoefner pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/main by this push:
new 974bde343f Open-API: Add table updates for statistics (#9564)
974bde343f is described below
commit 974bde343f324988c5d9095b9f65d7a101d9f7c7
Author: Marc Cenac <[email protected]>
AuthorDate: Thu Feb 1 01:46:49 2024 -0600
Open-API: Add table updates for statistics (#9564)
---
open-api/rest-catalog-open-api.py | 29 +++++++++++++
open-api/rest-catalog-open-api.yaml | 83 +++++++++++++++++++++++++++++++++++++
2 files changed, 112 insertions(+)
diff --git a/open-api/rest-catalog-open-api.py
b/open-api/rest-catalog-open-api.py
index cc70d6d4cd..719e77b0ad 100644
--- a/open-api/rest-catalog-open-api.py
+++ b/open-api/rest-catalog-open-api.py
@@ -342,6 +342,11 @@ class SetCurrentViewVersionUpdate(BaseUpdate):
)
+class RemoveStatisticsUpdate(BaseUpdate):
+ action: Literal['remove-statistics']
+ snapshot_id: int = Field(..., alias='snapshot-id')
+
+
class TableRequirement(BaseModel):
type: str
@@ -596,6 +601,14 @@ class UpdateNamespacePropertiesResponse(BaseModel):
)
+class BlobMetadata(BaseModel):
+ type: str
+ snapshot_id: int = Field(..., alias='snapshot-id')
+ sequence_number: int = Field(..., alias='sequence-number')
+ fields: List[int]
+ properties: Optional[Dict[str, Any]] = None
+
+
class CreateNamespaceRequest(BaseModel):
namespace: Namespace
properties: Optional[Dict[str, str]] = Field(
@@ -620,10 +633,24 @@ class ReportMetricsRequest2(CommitReport):
report_type: str = Field(..., alias='report-type')
+class StatisticsFile(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')
+ file_footer_size_in_bytes: int = Field(...,
alias='file-footer-size-in-bytes')
+ blob_metadata: List[BlobMetadata] = Field(..., alias='blob-metadata')
+
+
class Term(BaseModel):
__root__: Union[Reference, TransformTerm]
+class SetStatisticsUpdate(BaseUpdate):
+ action: Literal['set-statistics']
+ snapshot_id: int = Field(..., alias='snapshot-id')
+ statistics: StatisticsFile
+
+
class UnaryExpression(BaseModel):
type: ExpressionType
term: Term
@@ -758,6 +785,8 @@ class TableUpdate(BaseModel):
SetLocationUpdate,
SetPropertiesUpdate,
RemovePropertiesUpdate,
+ SetStatisticsUpdate,
+ RemoveStatisticsUpdate,
]
diff --git a/open-api/rest-catalog-open-api.yaml
b/open-api/rest-catalog-open-api.yaml
index f0819a1898..f622b9e21c 100644
--- a/open-api/rest-catalog-open-api.yaml
+++ b/open-api/rest-catalog-open-api.yaml
@@ -2150,6 +2150,8 @@ components:
remove-properties: '#/components/schemas/RemovePropertiesUpdate'
add-view-version: '#/components/schemas/AddViewVersionUpdate'
set-current-view-version:
'#/components/schemas/SetCurrentViewVersionUpdate'
+ set-statistics: '#/components/schemas/SetStatisticsUpdate'
+ remove-statistics: '#/components/schemas/RemoveStatisticsUpdate'
type: object
required:
- action
@@ -2394,6 +2396,37 @@ components:
type: integer
description: The view version id to set as current, or -1 to set
last added view version id
+ SetStatisticsUpdate:
+ allOf:
+ - $ref: '#/components/schemas/BaseUpdate'
+ required:
+ - action
+ - snapshot-id
+ - statistics
+ properties:
+ action:
+ type: string
+ enum: [ "set-statistics" ]
+ snapshot-id:
+ type: integer
+ format: int64
+ statistics:
+ $ref: '#/components/schemas/StatisticsFile'
+
+ RemoveStatisticsUpdate:
+ allOf:
+ - $ref: '#/components/schemas/BaseUpdate'
+ required:
+ - action
+ - snapshot-id
+ properties:
+ action:
+ type: string
+ enum: [ "remove-statistics" ]
+ snapshot-id:
+ type: integer
+ format: int64
+
TableUpdate:
anyOf:
- $ref: '#/components/schemas/AssignUUIDUpdate'
@@ -2411,6 +2444,8 @@ components:
- $ref: '#/components/schemas/SetLocationUpdate'
- $ref: '#/components/schemas/SetPropertiesUpdate'
- $ref: '#/components/schemas/RemovePropertiesUpdate'
+ - $ref: '#/components/schemas/SetStatisticsUpdate'
+ - $ref: '#/components/schemas/RemoveStatisticsUpdate'
ViewUpdate:
anyOf:
@@ -3158,6 +3193,54 @@ components:
metadata:
$ref: '#/components/schemas/TableMetadata'
+ StatisticsFile:
+ type: object
+ required:
+ - snapshot-id
+ - statistics-path
+ - file-size-in-bytes
+ - file-footer-size-in-bytes
+ - blob-metadata
+ properties:
+ snapshot-id:
+ type: integer
+ format: int64
+ statistics-path:
+ type: string
+ file-size-in-bytes:
+ type: integer
+ format: int64
+ file-footer-size-in-bytes:
+ type: integer
+ format: int64
+ blob-metadata:
+ type: array
+ items:
+ $ref: '#/components/schemas/BlobMetadata'
+
+ BlobMetadata:
+ type: object
+ required:
+ - type
+ - snapshot-id
+ - sequence-number
+ - fields
+ properties:
+ type:
+ type: string
+ snapshot-id:
+ type: integer
+ format: int64
+ sequence-number:
+ type: integer
+ format: int64
+ fields:
+ type: array
+ items:
+ type: integer
+ properties:
+ type: object
+
#############################
# Reusable Response Objects #