iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
iceberg::ManifestEntry Struct Reference

A manifest is an immutable Avro file that lists data files or delete files, along with each file's partition data tuple, metrics, and tracking information. More...

#include <manifest_entry.h>

Public Member Functions

constexpr bool IsAlive () const
 Check if this manifest entry is deleted.
 
ManifestEntry AsAdded () const
 
ManifestEntry AsExisting () const
 
ManifestEntry AsDeleted () const
 
bool operator== (const ManifestEntry &other) const
 

Static Public Member Functions

static std::shared_ptr< StructTypeTypeFromPartitionType (std::shared_ptr< StructType > partition_type)
 
static std::shared_ptr< StructTypeTypeFromDataFileType (std::shared_ptr< StructType > datafile_type)
 

Public Attributes

ManifestStatus status = ManifestStatus::kAdded
 
std::optional< int64_t > snapshot_id
 
std::optional< int64_t > sequence_number
 
std::optional< int64_t > file_sequence_number
 
std::shared_ptr< DataFiledata_file
 

Static Public Attributes

static constexpr int32_t kStatusFieldId = 0
 
static const SchemaField kStatus
 
static constexpr int32_t kSnapshotIdFieldId = 1
 
static const SchemaField kSnapshotId
 
static constexpr int32_t kDataFileFieldId = 2
 
static const std::string kDataFileField = "data_file"
 
static constexpr int32_t kSequenceNumberFieldId = 3
 
static const SchemaField kSequenceNumber
 
static constexpr int32_t kFileSequenceNumberFieldId = 4
 
static const SchemaField kFileSequenceNumber
 

Detailed Description

A manifest is an immutable Avro file that lists data files or delete files, along with each file's partition data tuple, metrics, and tracking information.

The schema of a manifest file

Member Data Documentation

◆ data_file

std::shared_ptr<DataFile> iceberg::ManifestEntry::data_file

Field id: 2 File path, partition tuple, metrics, ...

◆ file_sequence_number

std::optional<int64_t> iceberg::ManifestEntry::file_sequence_number

Field id: 4 The file sequence number.

The file sequence number represents the sequence number of the snapshot in which the underlying file was added. The file sequence number is always assigned at commit and cannot be provided explicitly, unlike the data sequence number. The file sequence number does not change upon assigning and must be preserved in existing and deleted entries.

Note
It can return nullopt if the file sequence number is unknown. This may happen while reading a v2 manifest that did not persist the file sequence number for manifest entries with status EXISTING or DELETED (older Iceberg versions).

◆ kFileSequenceNumber

const SchemaField iceberg::ManifestEntry::kFileSequenceNumber
inlinestatic
Initial value:
kFileSequenceNumberFieldId, "file_sequence_number", int64())
static SchemaField MakeOptional(int32_t field_id, std::string_view name, std::shared_ptr< Type > type, std::string_view doc={})
Construct an optional (nullable) field.
Definition schema_field.cc:38
ICEBERG_EXPORT const std::shared_ptr< LongType > & int64()
Return a LongType instance.

◆ kSequenceNumber

const SchemaField iceberg::ManifestEntry::kSequenceNumber
inlinestatic
Initial value:
=
SchemaField::MakeOptional(kSequenceNumberFieldId, "sequence_number", int64())

◆ kSnapshotId

const SchemaField iceberg::ManifestEntry::kSnapshotId
inlinestatic
Initial value:
=
SchemaField::MakeOptional(kSnapshotIdFieldId, "snapshot_id", int64())

◆ kStatus

const SchemaField iceberg::ManifestEntry::kStatus
inlinestatic
Initial value:
=
SchemaField::MakeRequired(kStatusFieldId, "status", int32())
static SchemaField MakeRequired(int32_t field_id, std::string_view name, std::shared_ptr< Type > type, std::string_view doc={})
Construct a required (non-null) field.
Definition schema_field.cc:43
ICEBERG_EXPORT const std::shared_ptr< IntType > & int32()
Return an IntType instance.

◆ sequence_number

std::optional<int64_t> iceberg::ManifestEntry::sequence_number

Field id: 3 Data sequence number of the file.

Independently of the entry status, it represents the sequence number to which the file should apply. Note the data sequence number may differ from the sequence number of the snapshot in which the underlying file was added. New snapshots can add files that belong to older sequence numbers (e.g. compaction). The data sequence number also does not change when the file is marked as deleted.

Note
It can return nullopt if the data sequence number is unknown. This may happen while reading a v2 manifest that did not persist the data sequence number for manifest entries with status DELETED (older Iceberg versions).

◆ snapshot_id

std::optional<int64_t> iceberg::ManifestEntry::snapshot_id

Field id: 1 Snapshot id where the file was added, or deleted if status is 2. Inherited when null.

◆ status

ManifestStatus iceberg::ManifestEntry::status = ManifestStatus::kAdded

Field id: 0 Used to track additions and deletions. Deletes are informational only and not used in scans.


The documentation for this struct was generated from the following files: