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

A scan task for deletes generated by removing a data file from the table. More...

#include <table_scan.h>

Inheritance diagram for iceberg::DeletedDataFileScanTask:
iceberg::ChangelogScanTask iceberg::ScanTask

Public Member Functions

ChangelogOperation operation () const override
 
const std::shared_ptr< DataFile > & data_file () const
 The data file that was deleted.
 
const std::vector< std::shared_ptr< DataFile > > & existing_deletes () const
 A list of previously added delete files to apply when reading the data file in this task.
 
 ChangelogScanTask (int32_t change_ordinal, int64_t commit_snapshot_id, std::shared_ptr< DataFile > data_file, std::vector< std::shared_ptr< DataFile > > delete_files={}, std::shared_ptr< Expression > residual_filter=nullptr)
 Construct an AddedRowsScanTask.
 
- Public Member Functions inherited from iceberg::ChangelogScanTask
 ChangelogScanTask (int32_t change_ordinal, int64_t commit_snapshot_id, std::shared_ptr< DataFile > data_file, std::vector< std::shared_ptr< DataFile > > delete_files={}, std::shared_ptr< Expression > residual_filter=nullptr)
 Construct an AddedRowsScanTask.
 
Kind kind () const override
 The kind of scan task.
 
int64_t size_bytes () const override
 The number of bytes that should be read by this scan task.
 
int32_t files_count () const override
 The number of files that should be read by this scan task.
 
int64_t estimated_row_count () const override
 The number of rows that should be read by this scan task.
 
int32_t change_ordinal () const
 The position of this change in the changelog order (0-based).
 
int64_t commit_snapshot_id () const
 The snapshot ID that committed this change.
 
const std::shared_ptr< Expression > & residual_filter () const
 Residual filter to apply after reading.
 

Additional Inherited Members

- Public Types inherited from iceberg::ScanTask
enum class  Kind : uint8_t { kFileScanTask , kChangelogScanTask }
 
- Protected Attributes inherited from iceberg::ChangelogScanTask
int32_t change_ordinal_
 
int64_t commit_snapshot_id_
 
std::shared_ptr< DataFiledata_file_
 
std::vector< std::shared_ptr< DataFile > > delete_files_
 
std::shared_ptr< Expressionresidual_filter_
 

Detailed Description

A scan task for deletes generated by removing a data file from the table.

All historical delete files added earlier must be applied while reading the data file. This is required to output only those data records that were live when the data file was removed.

Suppose snapshot S1 contains data files F1, F2, F3. Then snapshot S2 adds a position delete file, D1, that deletes records from F2 and snapshot S3 removes F2 entirely. A scan for changes generated by S3 should include the following task:

Readers consuming these tasks should produce deleted records with metadata like change ordinal and commit snapshot ID.

Member Function Documentation

◆ ChangelogScanTask()

iceberg::ChangelogScanTask::ChangelogScanTask ( int32_t  change_ordinal,
int64_t  commit_snapshot_id,
std::shared_ptr< DataFile data_file,
std::vector< std::shared_ptr< DataFile > >  delete_files = {},
std::shared_ptr< Expression residual_filter = nullptr 
)
inline

Construct an AddedRowsScanTask.

Parameters
change_ordinalPosition in the changelog order (0-based).
commit_snapshot_idThe snapshot ID that committed this change.
data_fileThe data file containing the added rows.
delete_filesDelete files that apply to this data file.
residual_filterOptional residual filter to apply after reading.

◆ existing_deletes()

const std::vector< std::shared_ptr< DataFile > > & iceberg::DeletedDataFileScanTask::existing_deletes ( ) const
inline

A list of previously added delete files to apply when reading the data file in this task.

Returns
A list of delete files to apply

◆ operation()

ChangelogOperation iceberg::DeletedDataFileScanTask::operation ( ) const
inlineoverridevirtual

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