You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "geruh (via GitHub)" <gi...@apache.org> on 2025/12/24 02:06:02 UTC
[PR] feat: Add models for rest scan planning [iceberg-python]
geruh opened a new pull request, #2861:
URL: https://github.com/apache/iceberg-python/pull/2861
related to #2775 and #2792
# Rationale for this change
This PR adds the Pydantic models for the REST catalog server-side scan planning API focusing on the synchronous use cases first.
There's some redundancy here with things like `RESTDataFile` vs the existing `DataFile` in the manifest module.
As mentioned in #2792 the manifest logic with encoding/decoding is dependency on Avro. Rather than trying to solve that unification problem upfront and blocking ourselves, I went with separate REST pydantic types for now. The plan is to eventually add conversion methods or a common interface so these can work together with our existing scan task and content file types.
The models and tests here align with the Java implementation.
## Are these changes tested?
Yes, added tests and works against POC
## Are there any user-facing changes?
No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: Add models for rest scan planning [iceberg-python]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on PR #2861:
URL: https://github.com/apache/iceberg-python/pull/2861#issuecomment-3697334701
Thanks for the PR @geruh
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: Add models for rest scan planning [iceberg-python]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on code in PR #2861:
URL: https://github.com/apache/iceberg-python/pull/2861#discussion_r2646197333
##########
pyiceberg/catalog/rest/scan_planning.py:
##########
@@ -0,0 +1,208 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+from datetime import date, datetime, time
+from decimal import Decimal
+from typing import Annotated, Generic, Literal, TypeAlias, TypeVar
+from uuid import UUID
+
+from pydantic import Field, model_validator
+
+from pyiceberg.catalog.rest.response import ErrorResponseMessage
+from pyiceberg.expressions import BooleanExpression
+from pyiceberg.manifest import FileFormat
+from pyiceberg.typedef import IcebergBaseModel
+
+# Primitive types that can appear in partition values and bounds
+PrimitiveTypeValue: TypeAlias = bool | int | float | str | Decimal | UUID | date | time | datetime | bytes
+
+V = TypeVar("V")
+
+
+class KeyValueMap(IcebergBaseModel, Generic[V]):
+ """Map serialized as parallel key/value arrays for column statistics."""
+
+ keys: list[int] = Field(default_factory=list)
+ values: list[V] = Field(default_factory=list)
+
+ @model_validator(mode="after")
+ def _validate_lengths_match(self) -> KeyValueMap[V]:
+ if len(self.keys) != len(self.values):
+ raise ValueError(f"keys and values must have same length: {len(self.keys)} != {len(self.values)}")
+ return self
+
+ def to_dict(self) -> dict[int, V]:
+ """Convert to dictionary mapping field ID to value."""
+ return dict(zip(self.keys, self.values, strict=True))
+
+
+class CountMap(KeyValueMap[int]):
+ """Map of field IDs to counts."""
+
+
+class ValueMap(KeyValueMap[PrimitiveTypeValue]):
+ """Map of field IDs to primitive values (for lower/upper bounds)."""
+
+
+class StorageCredential(IcebergBaseModel):
+ """Storage credential for accessing content files."""
+
+ prefix: str = Field(description="Storage location prefix this credential applies to")
+ config: dict[str, str] = Field(default_factory=dict)
+
+
+class RESTContentFile(IcebergBaseModel):
+ """Base model for data and delete files from REST API."""
+
+ spec_id: int = Field(alias="spec-id")
+ partition: list[PrimitiveTypeValue] = Field(default_factory=list)
+ content: Literal["data", "position-deletes", "equality-deletes"]
+ file_path: str = Field(alias="file-path")
+ file_format: FileFormat = Field(alias="file-format")
+ file_size_in_bytes: int = Field(alias="file-size-in-bytes")
+ record_count: int = Field(alias="record-count")
+ key_metadata: str | None = Field(alias="key-metadata", default=None)
+ split_offsets: list[int] | None = Field(alias="split-offsets", default=None)
+ sort_order_id: int | None = Field(alias="sort-order-id", default=None)
+
+
+class RESTDataFile(RESTContentFile):
+ """Data file from REST API."""
+
+ content: Literal["data"] = Field(default="data")
+ first_row_id: int | None = Field(alias="first-row-id", default=None)
+ column_sizes: CountMap | None = Field(alias="column-sizes", default=None)
+ value_counts: CountMap | None = Field(alias="value-counts", default=None)
+ null_value_counts: CountMap | None = Field(alias="null-value-counts", default=None)
+ nan_value_counts: CountMap | None = Field(alias="nan-value-counts", default=None)
+ lower_bounds: ValueMap | None = Field(alias="lower-bounds", default=None)
+ upper_bounds: ValueMap | None = Field(alias="upper-bounds", default=None)
+
+
+class RESTPositionDeleteFile(RESTContentFile):
+ """Position delete file from REST API."""
+
+ content: Literal["position-deletes"] = Field(default="position-deletes")
+ referenced_data_file: str | None = Field(alias="referenced-data-file", default=None)
Review Comment:
```suggestion
```
`PositionDeleteFile` doesnt have this
https://github.com/apache/iceberg/blob/0651b8913d27c3b1c9aca4a9609bec521905fb36/open-api/rest-catalog-open-api.yaml#L4450-L4466
##########
pyiceberg/catalog/rest/scan_planning.py:
##########
@@ -0,0 +1,208 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+from datetime import date, datetime, time
+from decimal import Decimal
+from typing import Annotated, Generic, Literal, TypeAlias, TypeVar
+from uuid import UUID
+
+from pydantic import Field, model_validator
+
+from pyiceberg.catalog.rest.response import ErrorResponseMessage
+from pyiceberg.expressions import BooleanExpression
+from pyiceberg.manifest import FileFormat
+from pyiceberg.typedef import IcebergBaseModel
+
+# Primitive types that can appear in partition values and bounds
+PrimitiveTypeValue: TypeAlias = bool | int | float | str | Decimal | UUID | date | time | datetime | bytes
+
+V = TypeVar("V")
+
+
+class KeyValueMap(IcebergBaseModel, Generic[V]):
+ """Map serialized as parallel key/value arrays for column statistics."""
+
+ keys: list[int] = Field(default_factory=list)
+ values: list[V] = Field(default_factory=list)
+
+ @model_validator(mode="after")
+ def _validate_lengths_match(self) -> KeyValueMap[V]:
+ if len(self.keys) != len(self.values):
+ raise ValueError(f"keys and values must have same length: {len(self.keys)} != {len(self.values)}")
+ return self
+
+ def to_dict(self) -> dict[int, V]:
+ """Convert to dictionary mapping field ID to value."""
+ return dict(zip(self.keys, self.values, strict=True))
+
+
+class CountMap(KeyValueMap[int]):
+ """Map of field IDs to counts."""
+
+
+class ValueMap(KeyValueMap[PrimitiveTypeValue]):
+ """Map of field IDs to primitive values (for lower/upper bounds)."""
+
+
+class StorageCredential(IcebergBaseModel):
+ """Storage credential for accessing content files."""
+
+ prefix: str = Field(description="Storage location prefix this credential applies to")
+ config: dict[str, str] = Field(default_factory=dict)
+
+
+class RESTContentFile(IcebergBaseModel):
+ """Base model for data and delete files from REST API."""
+
+ spec_id: int = Field(alias="spec-id")
+ partition: list[PrimitiveTypeValue] = Field(default_factory=list)
+ content: Literal["data", "position-deletes", "equality-deletes"]
+ file_path: str = Field(alias="file-path")
+ file_format: FileFormat = Field(alias="file-format")
+ file_size_in_bytes: int = Field(alias="file-size-in-bytes")
+ record_count: int = Field(alias="record-count")
+ key_metadata: str | None = Field(alias="key-metadata", default=None)
+ split_offsets: list[int] | None = Field(alias="split-offsets", default=None)
+ sort_order_id: int | None = Field(alias="sort-order-id", default=None)
+
+
+class RESTDataFile(RESTContentFile):
+ """Data file from REST API."""
+
+ content: Literal["data"] = Field(default="data")
+ first_row_id: int | None = Field(alias="first-row-id", default=None)
+ column_sizes: CountMap | None = Field(alias="column-sizes", default=None)
+ value_counts: CountMap | None = Field(alias="value-counts", default=None)
+ null_value_counts: CountMap | None = Field(alias="null-value-counts", default=None)
+ nan_value_counts: CountMap | None = Field(alias="nan-value-counts", default=None)
+ lower_bounds: ValueMap | None = Field(alias="lower-bounds", default=None)
+ upper_bounds: ValueMap | None = Field(alias="upper-bounds", default=None)
+
+
+class RESTPositionDeleteFile(RESTContentFile):
+ """Position delete file from REST API."""
+
+ content: Literal["position-deletes"] = Field(default="position-deletes")
+ referenced_data_file: str | None = Field(alias="referenced-data-file", default=None)
+ content_offset: int | None = Field(alias="content-offset", default=None)
+ content_size_in_bytes: int | None = Field(alias="content-size-in-bytes", default=None)
+
+
+class RESTEqualityDeleteFile(RESTContentFile):
+ """Equality delete file from REST API."""
+
+ content: Literal["equality-deletes"] = Field(default="equality-deletes")
+ equality_ids: list[int] | None = Field(alias="equality-ids", default=None)
+
+
+# Discriminated union for delete files
+RESTDeleteFile = Annotated[
+ RESTPositionDeleteFile | RESTEqualityDeleteFile,
+ Field(discriminator="content"),
+]
+
+
+class RESTFileScanTask(IcebergBaseModel):
+ """A file scan task from the REST server."""
+
+ data_file: RESTDataFile = Field(alias="data-file")
+ delete_file_references: list[int] | None = Field(alias="delete-file-references", default=None)
+ residual_filter: BooleanExpression | None = Field(alias="residual-filter", default=None)
+
+
+class ScanTasks(IcebergBaseModel):
+ """Container for scan tasks returned by the server."""
+
+ delete_files: list[RESTDeleteFile] = Field(alias="delete-files", default_factory=list)
+ file_scan_tasks: list[RESTFileScanTask] = Field(alias="file-scan-tasks", default_factory=list)
+ plan_tasks: list[str] = Field(alias="plan-tasks", default_factory=list)
+
+ @model_validator(mode="after")
+ def _validate_delete_file_references(self) -> ScanTasks:
+ # validate delete file references are in bounds
+ max_idx = len(self.delete_files) - 1
+ for task in self.file_scan_tasks:
+ for idx in task.delete_file_references or []:
+ if idx < 0 or idx > max_idx:
+ raise ValueError(f"Invalid delete file reference: {idx} (valid range: 0-{max_idx})")
+
+ if self.delete_files and not self.file_scan_tasks:
+ raise ValueError("Invalid response: deleteFiles should only be returned with fileScanTasks that reference them")
+
+ return self
+
+
+class PlanCompleted(ScanTasks):
+ """Completed scan plan result."""
+
+ status: Literal["completed"] = "completed"
+ plan_id: str | None = Field(alias="plan-id", default=None)
+ storage_credentials: list[StorageCredential] | None = Field(alias="storage-credentials", default=None)
+
+
+class PlanSubmitted(IcebergBaseModel):
+ """Scan plan submitted, poll for completion."""
+
+ status: Literal["submitted"] = "submitted"
+ plan_id: str | None = Field(alias="plan-id", default=None)
+
+
+class PlanCancelled(IcebergBaseModel):
+ """Planning was cancelled."""
+
+ status: Literal["cancelled"] = "cancelled"
+
+
+class PlanFailed(IcebergBaseModel):
+ """Planning failed with error."""
+
+ status: Literal["failed"] = "failed"
+ error: ErrorResponseMessage
+
+
+PlanningResponse = Annotated[
+ PlanCompleted | PlanSubmitted | PlanCancelled | PlanFailed,
+ Field(discriminator="status"),
+]
+
+
+class PlanTableScanRequest(IcebergBaseModel):
+ """Request body for planning a REST scan."""
+
+ snapshot_id: int | None = Field(alias="snapshot-id", default=None)
+ select: list[str] | None = Field(default=None)
+ filter: BooleanExpression | None = Field(default=None)
Review Comment:
```suggestion
filter: BooleanExpression | None = Field(default=None)
min_rows_requested: int | None = Field(alias="min-rows-requested", default=None)
```
missing `min_rows_requested` https://github.com/apache/iceberg/blob/0651b8913d27c3b1c9aca4a9609bec521905fb36/open-api/rest-catalog-open-api.yaml#L4483-L4507
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: Add models for rest scan planning [iceberg-python]
Posted by "geruh (via GitHub)" <gi...@apache.org>.
geruh commented on code in PR #2861:
URL: https://github.com/apache/iceberg-python/pull/2861#discussion_r2648883092
##########
pyiceberg/catalog/rest/scan_planning.py:
##########
@@ -0,0 +1,208 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+from datetime import date, datetime, time
+from decimal import Decimal
+from typing import Annotated, Generic, Literal, TypeAlias, TypeVar
+from uuid import UUID
+
+from pydantic import Field, model_validator
+
+from pyiceberg.catalog.rest.response import ErrorResponseMessage
+from pyiceberg.expressions import BooleanExpression
+from pyiceberg.manifest import FileFormat
+from pyiceberg.typedef import IcebergBaseModel
+
+# Primitive types that can appear in partition values and bounds
+PrimitiveTypeValue: TypeAlias = bool | int | float | str | Decimal | UUID | date | time | datetime | bytes
+
+V = TypeVar("V")
+
+
+class KeyValueMap(IcebergBaseModel, Generic[V]):
+ """Map serialized as parallel key/value arrays for column statistics."""
+
+ keys: list[int] = Field(default_factory=list)
+ values: list[V] = Field(default_factory=list)
+
+ @model_validator(mode="after")
+ def _validate_lengths_match(self) -> KeyValueMap[V]:
+ if len(self.keys) != len(self.values):
+ raise ValueError(f"keys and values must have same length: {len(self.keys)} != {len(self.values)}")
+ return self
+
+ def to_dict(self) -> dict[int, V]:
+ """Convert to dictionary mapping field ID to value."""
+ return dict(zip(self.keys, self.values, strict=True))
+
+
+class CountMap(KeyValueMap[int]):
+ """Map of field IDs to counts."""
+
+
+class ValueMap(KeyValueMap[PrimitiveTypeValue]):
+ """Map of field IDs to primitive values (for lower/upper bounds)."""
+
+
+class StorageCredential(IcebergBaseModel):
+ """Storage credential for accessing content files."""
+
+ prefix: str = Field(description="Storage location prefix this credential applies to")
+ config: dict[str, str] = Field(default_factory=dict)
+
+
+class RESTContentFile(IcebergBaseModel):
+ """Base model for data and delete files from REST API."""
+
+ spec_id: int = Field(alias="spec-id")
+ partition: list[PrimitiveTypeValue] = Field(default_factory=list)
+ content: Literal["data", "position-deletes", "equality-deletes"]
+ file_path: str = Field(alias="file-path")
+ file_format: FileFormat = Field(alias="file-format")
+ file_size_in_bytes: int = Field(alias="file-size-in-bytes")
+ record_count: int = Field(alias="record-count")
+ key_metadata: str | None = Field(alias="key-metadata", default=None)
+ split_offsets: list[int] | None = Field(alias="split-offsets", default=None)
+ sort_order_id: int | None = Field(alias="sort-order-id", default=None)
+
+
+class RESTDataFile(RESTContentFile):
+ """Data file from REST API."""
+
+ content: Literal["data"] = Field(default="data")
+ first_row_id: int | None = Field(alias="first-row-id", default=None)
+ column_sizes: CountMap | None = Field(alias="column-sizes", default=None)
+ value_counts: CountMap | None = Field(alias="value-counts", default=None)
+ null_value_counts: CountMap | None = Field(alias="null-value-counts", default=None)
+ nan_value_counts: CountMap | None = Field(alias="nan-value-counts", default=None)
+ lower_bounds: ValueMap | None = Field(alias="lower-bounds", default=None)
+ upper_bounds: ValueMap | None = Field(alias="upper-bounds", default=None)
+
+
+class RESTPositionDeleteFile(RESTContentFile):
+ """Position delete file from REST API."""
+
+ content: Literal["position-deletes"] = Field(default="position-deletes")
+ referenced_data_file: str | None = Field(alias="referenced-data-file", default=None)
Review Comment:
let's omit this for now, as its redundant with the `delete-file-references`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: Add models for rest scan planning [iceberg-python]
Posted by "geruh (via GitHub)" <gi...@apache.org>.
geruh commented on code in PR #2861:
URL: https://github.com/apache/iceberg-python/pull/2861#discussion_r2646278706
##########
pyiceberg/catalog/rest/scan_planning.py:
##########
@@ -0,0 +1,208 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+from datetime import date, datetime, time
+from decimal import Decimal
+from typing import Annotated, Generic, Literal, TypeAlias, TypeVar
+from uuid import UUID
+
+from pydantic import Field, model_validator
+
+from pyiceberg.catalog.rest.response import ErrorResponseMessage
+from pyiceberg.expressions import BooleanExpression
+from pyiceberg.manifest import FileFormat
+from pyiceberg.typedef import IcebergBaseModel
+
+# Primitive types that can appear in partition values and bounds
+PrimitiveTypeValue: TypeAlias = bool | int | float | str | Decimal | UUID | date | time | datetime | bytes
+
+V = TypeVar("V")
+
+
+class KeyValueMap(IcebergBaseModel, Generic[V]):
+ """Map serialized as parallel key/value arrays for column statistics."""
+
+ keys: list[int] = Field(default_factory=list)
+ values: list[V] = Field(default_factory=list)
+
+ @model_validator(mode="after")
+ def _validate_lengths_match(self) -> KeyValueMap[V]:
+ if len(self.keys) != len(self.values):
+ raise ValueError(f"keys and values must have same length: {len(self.keys)} != {len(self.values)}")
+ return self
+
+ def to_dict(self) -> dict[int, V]:
+ """Convert to dictionary mapping field ID to value."""
+ return dict(zip(self.keys, self.values, strict=True))
+
+
+class CountMap(KeyValueMap[int]):
+ """Map of field IDs to counts."""
+
+
+class ValueMap(KeyValueMap[PrimitiveTypeValue]):
+ """Map of field IDs to primitive values (for lower/upper bounds)."""
+
+
+class StorageCredential(IcebergBaseModel):
+ """Storage credential for accessing content files."""
+
+ prefix: str = Field(description="Storage location prefix this credential applies to")
+ config: dict[str, str] = Field(default_factory=dict)
+
+
+class RESTContentFile(IcebergBaseModel):
+ """Base model for data and delete files from REST API."""
+
+ spec_id: int = Field(alias="spec-id")
+ partition: list[PrimitiveTypeValue] = Field(default_factory=list)
+ content: Literal["data", "position-deletes", "equality-deletes"]
+ file_path: str = Field(alias="file-path")
+ file_format: FileFormat = Field(alias="file-format")
+ file_size_in_bytes: int = Field(alias="file-size-in-bytes")
+ record_count: int = Field(alias="record-count")
+ key_metadata: str | None = Field(alias="key-metadata", default=None)
+ split_offsets: list[int] | None = Field(alias="split-offsets", default=None)
+ sort_order_id: int | None = Field(alias="sort-order-id", default=None)
+
+
+class RESTDataFile(RESTContentFile):
+ """Data file from REST API."""
+
+ content: Literal["data"] = Field(default="data")
+ first_row_id: int | None = Field(alias="first-row-id", default=None)
+ column_sizes: CountMap | None = Field(alias="column-sizes", default=None)
+ value_counts: CountMap | None = Field(alias="value-counts", default=None)
+ null_value_counts: CountMap | None = Field(alias="null-value-counts", default=None)
+ nan_value_counts: CountMap | None = Field(alias="nan-value-counts", default=None)
+ lower_bounds: ValueMap | None = Field(alias="lower-bounds", default=None)
+ upper_bounds: ValueMap | None = Field(alias="upper-bounds", default=None)
+
+
+class RESTPositionDeleteFile(RESTContentFile):
+ """Position delete file from REST API."""
+
+ content: Literal["position-deletes"] = Field(default="position-deletes")
+ referenced_data_file: str | None = Field(alias="referenced-data-file", default=None)
Review Comment:
Ahh yeah it's another gap in the spec. This was for v3 puffin file.
```
curl -s -X POST http://localhost:8181/v1/namespaces/default/tables/test_positional_mor_deletes_v3/plan \
-H "Content-Type: application/json" \
-d '{"snapshot-id":null,"filter":true,"case-sensitive":true}' | jq
{
"status": "completed",
"plan-id": "sync-e1f10f90-b25e-41f4-a089-dcd66a0a2b33",
"delete-files": [
{
"spec-id": 0,
"content": "position-deletes",
"file-path": "s3://warehouse/default/test_positional_mor_deletes_v3/data/00000-24-214b8ae2-af1b-4caf-88e9-08481c4161d1-00001-deletes.puffin",
"file-format": "puffin",
"partition": [],
"file-size-in-bytes": 467,
"record-count": 1,
"referenced-data-file": "s3://warehouse/default/test_positional_mor_deletes_v3/data/00000-20-309d44b6-a7ee-4309-b629-292375bf84c5-0-00001.parquet",
"content-offset": 4,
"content-size-in-bytes": 42
}
],
"file-scan-tasks": [
{
"data-file": {
"spec-id": 0,
"content": "data",
"file-path": "s3://warehouse/default/test_positional_mor_deletes_v3/data/00000-20-309d44b6-a7ee-4309-b629-292375bf84c5-0-00001.parquet",
"file-format": "parquet",
"partition": [],
"file-size-in-bytes": 1009,
"record-count": 12,
"split-offsets": [
4
],
"sort-order-id": 0,
"first-row-id": 0
},
"delete-file-references": [
0
],
"residual-filter": true
}
]
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: Add models for rest scan planning [iceberg-python]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu merged PR #2861:
URL: https://github.com/apache/iceberg-python/pull/2861
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org