rdblue commented on code in PR #6775:
URL: https://github.com/apache/iceberg/pull/6775#discussion_r1199486929
##########
python/pyiceberg/table/__init__.py:
##########
@@ -301,35 +304,44 @@ class ScanTask(ABC):
@dataclass(init=False)
class FileScanTask(ScanTask):
file: DataFile
+ delete_files: Set[DataFile]
start: int
length: int
- def __init__(self, data_file: DataFile, start: Optional[int] = None,
length: Optional[int] = None):
+ def __init__(
+ self,
+ data_file: DataFile,
+ delete_files: Optional[Set[DataFile]] = None,
+ start: Optional[int] = None,
+ length: Optional[int] = None,
+ ):
self.file = data_file
+ self.delete_files = delete_files or set()
self.start = start or 0
self.length = length or data_file.file_size_in_bytes
-def _check_content(file: DataFile) -> DataFile:
- try:
- if file.content == ManifestContent.DELETES:
- raise ValueError("PyIceberg does not support deletes:
https://github.com/apache/iceberg/issues/6568")
- return file
- except AttributeError:
- # If the attribute is not there, it is a V1 record
- return file
-
-
def _open_manifest(
io: FileIO,
manifest: ManifestFile,
partition_filter: Callable[[DataFile], bool],
metrics_evaluator: Callable[[DataFile], bool],
-) -> List[FileScanTask]:
- all_files = files(io.new_input(manifest.manifest_path))
- matching_partition_files = filter(partition_filter, all_files)
- matching_partition_data_files = map(_check_content,
matching_partition_files)
- return [FileScanTask(file) for file in matching_partition_data_files if
metrics_evaluator(file)]
+) -> List[DataFile]:
+ result_manifests = files(io.new_input(manifest.manifest_path))
+ result_manifests = filter(partition_filter, result_manifests)
+ return [file for file in result_manifests if metrics_evaluator(file)]
+
+
+def _min_sequence_number(manifests: List[ManifestFile]) -> int:
Review Comment:
How about `_min_data_file_sequence_number` to show that this skips delete
manifests?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]