Skip to content

Commit 8ef9be4

Browse files
author
ZENOTME
committed
support rewrite manifest
1 parent 06d5321 commit 8ef9be4

File tree

4 files changed

+1135
-28
lines changed

4 files changed

+1135
-28
lines changed

crates/iceberg/src/spec/manifest_list.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ mod _const_schema {
507507
}
508508

509509
/// Entry in a manifest list.
510-
#[derive(Debug, PartialEq, Clone)]
510+
#[derive(Debug, PartialEq, Clone, Eq, Hash)]
511511
pub struct ManifestFile {
512512
/// field: 500
513513
///
@@ -590,14 +590,19 @@ impl ManifestFile {
590590
self.added_files_count.is_none() || self.added_files_count.unwrap() > 0
591591
}
592592

593+
/// Checks whether this manifest contains entries with DELETED status.
594+
pub fn has_deleted_files(&self) -> bool {
595+
self.deleted_files_count.is_none() || self.deleted_files_count.unwrap() > 0
596+
}
597+
593598
/// Checks if the manifest file has any existed files.
594599
pub fn has_existing_files(&self) -> bool {
595600
self.existing_files_count.is_none() || self.existing_files_count.unwrap() > 0
596601
}
597602
}
598603

599604
/// The type of files tracked by the manifest, either data or delete files; Data(0) for all v1 manifests
600-
#[derive(Debug, PartialEq, Clone, Copy, Eq)]
605+
#[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
601606
pub enum ManifestContentType {
602607
/// The manifest content is data.
603608
Data = 0,
@@ -668,7 +673,7 @@ impl ManifestFile {
668673
/// Field summary for partition field in the spec.
669674
///
670675
/// Each field in the list corresponds to a field in the manifest file’s partition spec.
671-
#[derive(Debug, PartialEq, Eq, Clone, Default)]
676+
#[derive(Debug, PartialEq, Eq, Clone, Default, Hash)]
672677
pub struct FieldSummary {
673678
/// field: 509
674679
///

0 commit comments

Comments
 (0)