Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
fix: Scan should exclude deleted files. (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
liurenjie1024 authored Jan 31, 2024
1 parent 3f61f90 commit 56943d2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions icelake/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ use url::Url;

use crate::config::{TableConfig, TableConfigRef};
use crate::types::{
Any, DataFile, FieldProjector, PartitionSplitter, Schema, Snapshot, TableMetadata,
Any, DataFile, FieldProjector, ManifestStatus, PartitionSplitter, Schema, Snapshot,
TableMetadata,
};
use crate::{types, Error, ErrorKind};

Expand Down Expand Up @@ -290,7 +291,13 @@ impl Table {
let manifest_path = self.rel_path(&manifest_list_entry.manifest_path)?;
let manifest_content = self.op.read(&manifest_path).await?;
let manifest = types::parse_manifest_file(&manifest_content)?;
data_files.extend(manifest.entries.into_iter().map(|v| v.data_file));
data_files.extend(
manifest
.entries
.into_iter()
.filter(|f| f.status != ManifestStatus::Deleted)
.map(|v| v.data_file),
);
}

Ok(data_files)
Expand Down

0 comments on commit 56943d2

Please sign in to comment.