iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
iceberg::DeleteFileIndex Class Reference

An index of delete files by sequence number. More...

#include <delete_file_index.h>

Inheritance diagram for iceberg::DeleteFileIndex:

Public Member Functions

 DeleteFileIndex (DeleteFileIndex &&) noexcept
 
DeleteFileIndexoperator= (DeleteFileIndex &&) noexcept
 
 DeleteFileIndex (const DeleteFileIndex &)=delete
 
DeleteFileIndexoperator= (const DeleteFileIndex &)=delete
 
bool empty () const
 Check if this index is empty (has no delete files).
 
bool has_equality_deletes () const
 Check if this index has any equality delete files.
 
bool has_position_deletes () const
 Check if this index has any position delete files.
 
std::vector< std::shared_ptr< DataFile > > ReferencedDeleteFiles () const
 Get all delete files referenced by this index. TODO(gangwu): use lazy iterator to avoid large memory allocation.
 
Result< std::vector< std::shared_ptr< DataFile > > > ForEntry (const ManifestEntry &entry) const
 Get the delete files that apply to a manifest entry.
 
Result< std::vector< std::shared_ptr< DataFile > > > ForDataFile (int64_t sequence_number, const DataFile &file) const
 Get the delete files that apply to a data file with a specific sequence number.
 
 Builder (std::shared_ptr< FileIO > io, std::shared_ptr< Schema > schema, std::unordered_map< int32_t, std::shared_ptr< PartitionSpec > > specs_by_id, std::vector< ManifestFile > delete_manifests)
 Construct a builder from manifest files.
 
 Builder (Builder &&) noexcept
 
Builder & operator= (Builder &&) noexcept
 
 Builder (const Builder &)=delete
 
Builder & operator= (const Builder &)=delete
 
Builder & AfterSequenceNumber (int64_t seq)
 Set the minimum sequence number for delete files.
 
Builder & DataFilter (std::shared_ptr< Expression > filter)
 Set a row-level data filter.
 
Builder & PartitionFilter (std::shared_ptr< Expression > filter)
 Set a partition filter expression.
 
Builder & FilterPartitions (std::shared_ptr< PartitionSet > partition_set)
 Set a partition set to filter manifests.
 
Builder & CaseSensitive (bool case_sensitive)
 Set case sensitivity for column name matching.
 
Builder & IgnoreResiduals ()
 Ignore residual expressions after partition filtering.
 
Builder & PlanWith (OptionalExecutor executor)
 Configure an optional executor for reading delete manifests.
 
Result< std::unique_ptr< DeleteFileIndex > > Build ()
 Build the DeleteFileIndex.
 

Static Public Member Functions

static Result< Builder > BuilderFor (std::shared_ptr< FileIO > io, std::shared_ptr< Schema > schema, std::unordered_map< int32_t, std::shared_ptr< PartitionSpec > > specs_by_id, std::vector< ManifestFile > delete_manifests)
 Create a builder for constructing a DeleteFileIndex from manifest files.
 

Friends

class Builder
 

Detailed Description

An index of delete files by sequence number.

Use DeleteFileIndex::Builder to construct an index, and ForDataFile() or ForEntry() to get the delete files to apply to a given data file.

The index organizes delete files by:

Member Function Documentation

◆ AfterSequenceNumber()

Builder & iceberg::DeleteFileIndex::AfterSequenceNumber ( int64_t  seq)

Set the minimum sequence number for delete files.

Only delete files with sequence number > min_sequence_number will be included.

◆ BuilderFor()

Result< DeleteFileIndex::Builder > iceberg::DeleteFileIndex::BuilderFor ( std::shared_ptr< FileIO io,
std::shared_ptr< Schema schema,
std::unordered_map< int32_t, std::shared_ptr< PartitionSpec > >  specs_by_id,
std::vector< ManifestFile delete_manifests 
)
static

Create a builder for constructing a DeleteFileIndex from manifest files.

Parameters
ioThe FileIO to use for reading manifests
schemaCurrent table schema
specs_by_idPartition specs by their IDs
delete_manifestsThe delete manifests to index
Returns
A Builder instance

◆ DataFilter()

Builder & iceberg::DeleteFileIndex::DataFilter ( std::shared_ptr< Expression filter)

Set a row-level data filter.

This filter is projected to partition expressions for manifest pruning and then residuals are applied to data files.

◆ ForDataFile()

Result< std::vector< std::shared_ptr< DataFile > > > iceberg::DeleteFileIndex::ForDataFile ( int64_t  sequence_number,
const DataFile file 
) const

Get the delete files that apply to a data file with a specific sequence number.

Parameters
sequence_numberThe data sequence number of the data file
fileThe data file to find delete files for
Returns
Delete files that should be applied when reading the data file

◆ ForEntry()

Result< std::vector< std::shared_ptr< DataFile > > > iceberg::DeleteFileIndex::ForEntry ( const ManifestEntry entry) const

Get the delete files that apply to a manifest entry.

Parameters
entryThe manifest entry to find delete files for
Returns
Delete files that should be applied when reading the data file

◆ PlanWith()

Builder & iceberg::DeleteFileIndex::PlanWith ( OptionalExecutor  executor)

Configure an optional executor for reading delete manifests.

Parameters
executorExecutor to use, or std::nullopt to read manifests serially.
Returns
Reference to this for method chaining.

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