Skip to main content

DataFileEntry

Struct DataFileEntry 

Source
pub struct DataFileEntry {
Show 19 fields pub path: String, pub record_count: u64, pub file_size_bytes: u64, pub centroid_b64: Option<String>, pub radius: Option<f32>, pub hnsw_offset: Option<u64>, pub hnsw_len: Option<u64>, pub vector_column: Option<String>, pub vector_dim: Option<u32>, pub extra_vector_indexes: Vec<ExtraVectorIndex>, pub index_status: IndexStatus, pub index_error: Option<String>, pub batch_id: Option<String>, pub embedding_model: Option<String>, pub partition_value: Option<String>, pub deletion_vector: Option<DeletionVector>, pub first_row_id: Option<i64>, pub column_stats: Option<String>, pub sequence_number: i64,
}
Expand description

Metadata about a single data file in a table snapshot.

Fields§

§path: String

Relative path within the warehouse (e.g., “data/part-00001.parquet”)

§record_count: u64§file_size_bytes: u64§centroid_b64: Option<String>

base64-encoded centroid F32 values (primary vector column)

§radius: Option<f32>§hnsw_offset: Option<u64>§hnsw_len: Option<u64>§vector_column: Option<String>§vector_dim: Option<u32>§extra_vector_indexes: Vec<ExtraVectorIndex>

Additional vector columns beyond the primary (empty for single-column tables).

§index_status: IndexStatus

Index build status. Defaults to Ready for backward compatibility with old manifests.

§index_error: Option<String>

Human-readable error from a failed background index build. Set only when index_status == IndexStatus::Failed; None otherwise.

§batch_id: Option<String>

Caller-supplied idempotency key. When set, write_batch_idempotent skips the write if a file with the same batch_id is already committed in the snapshot.

§embedding_model: Option<String>

Embedding model identifier stored per-file so mixed-model tables (during migration) can be identified without reading the main metadata.json.

§partition_value: Option<String>

Partition value for this file (e.g. the agent_id UUID). Written per-file when VectorStoragePolicy::partition_by is set. Enables manifest-level pruning: search skips files whose partition_value doesn’t match the requested partition filter, avoiding all HNSW I/O.

§deletion_vector: Option<DeletionVector>

Iceberg V3 Deletion Vector: Roaring Bitmap of deleted row positions. None for V2 tables or V3 tables with no deletes for this file. When present, scanner masks these row IDs from HNSW results.

§first_row_id: Option<i64>

Iceberg V3 Row Lineage: globally unique first row ID assigned to this file. Computed at commit time from the table’s cumulative next-row-id counter. None for V2 tables (row lineage requires format-version=3).

§column_stats: Option<String>

JSON-encoded BTreeMap<i32, FieldStats> (column_stats::extract_column_stats), computed once from this file’s own Parquet footer at write/compaction time. write_manifest_file decodes this to emit real value_counts/ null_value_counts/column_sizes/lower_bounds/upper_bounds Avro fields instead of null, enabling row-group pruning for Spark/Trino/DuckDB reading the table as plain Iceberg. None for files predating this feature, or where extraction failed — always spec-safe since these fields are optional at every format version.

§sequence_number: i64

Iceberg data sequence number of the snapshot that added this file (spec manifest_entry.sequence_number). 0 for files predating this field (legacy manifests, or any in-memory entry not yet round-tripped through read_manifest_file) — safe because it only ever lowers an equality delete’s apparent reach (a delete with sequence_number > 0 still masks a 0-tagged file, same as before this field existed). Populated only on read (avro_manifest::read_manifest_file); writers never need to set it correctly — write_manifest_file always stamps every entry with the commit’s sequence number, ignoring whatever this field held going in. See EqualityDeleteFile::sequence_number doc for why both exist: Iceberg masks a data file only when data_file.sequence_number < delete_file.sequence_number, which is what makes an insert+delete of the same key inside one commit leave the insert visible (equal sequence numbers never mask).

Implementations§

Source§

impl DataFileEntry

Source

pub fn is_foreign(&self) -> bool

True iff this file was never written by the AI-Lake SDK — most likely rewritten by a generic Iceberg engine (Spark/Trino OPTIMIZE/rewrite_data_files, DuckDB) with no knowledge of AI-Lake.

Every AI-Lake write path (make_data_file_entry, make_data_file_entry_indexing) computes and stores a centroid unconditionally, even for IndexStatus::Indexing files — before the HNSW build itself completes. A missing centroid is therefore a reliable “not ours” signal, distinct from IndexStatus::Failed (an internal indexing failure on a file the SDK did write — see writer.rs::patch_index_failed, which never touches centroid_b64). Shared by CompactionPlanner::plan(), scanner.rs::search, and ailake info so the three can’t drift on the definition.

Source

pub fn batch_ids(&self) -> Vec<String>

Decode batch_id into the set of original idempotency keys it covers.

A freshly-written file’s batch_id is a plain string (the caller-supplied key). A file produced by compaction (merge_batch_ids) instead carries a JSON-encoded array of every source file’s key(s), since one merged file can supersede several idempotent writes at once. This tries the JSON-array form first and falls back to treating the raw string as a single key — the two encodings share the same Option<String> field so this is the only place that needs to know the difference. Returns [] when batch_id is None.

Source

pub fn merge_batch_ids(sources: &[DataFileEntry]) -> Option<String>

Build the batch_id value for a file merging sources (compaction).

Flattens every source’s batch_ids() (not just source.batch_id verbatim — a source may itself already be a previous merge, so this must decode before re-encoding to avoid nesting JSON arrays deeper on every subsequent compaction pass), dedups while preserving first-seen order, and re-encodes as a JSON array. Returns None when no source carried a batch_id — compaction of files that were never written idempotently produces a plain, key-less file, same as before this method existed.

Trait Implementations§

Source§

impl Clone for DataFileEntry

Source§

fn clone(&self) -> DataFileEntry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DataFileEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DataFileEntry

Source§

fn default() -> DataFileEntry

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for DataFileEntry

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for DataFileEntry

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more