Read manifest entries from a manifest file.
More...
#include <manifest_reader.h>
|
| static bool | ShouldDropStats (const std::vector< std::string > &columns) |
| | Determine whether stats should be dropped based on selected columns.
|
| |
| static Result< std::unique_ptr< ManifestReader > > | Make (const ManifestFile &manifest, std::shared_ptr< FileIO > file_io, std::shared_ptr< Schema > schema, std::shared_ptr< PartitionSpec > spec, bool is_committed=true) |
| | Creates a reader for a manifest file.
|
| |
| static Result< std::unique_ptr< ManifestReader > > | Make (const ManifestFile &manifest, std::shared_ptr< FileIO > file_io, std::shared_ptr< Schema > schema, const std::unordered_map< int32_t, std::shared_ptr< PartitionSpec > > &specs_by_id, bool is_committed=true) |
| | Creates a reader for a manifest file using specs keyed by ID.
|
| |
| static Result< std::unique_ptr< ManifestReader > > | Make (std::string_view manifest_location, std::optional< int64_t > manifest_length, std::shared_ptr< FileIO > file_io, std::shared_ptr< Schema > schema, std::shared_ptr< PartitionSpec > spec, std::unique_ptr< InheritableMetadata > inheritable_metadata, std::optional< int64_t > first_row_id=std::nullopt, bool is_committed=true) |
| | Creates a reader for a manifest file.
|
| |
|
static std::vector< std::string > | WithStatsColumns (const std::vector< std::string > &columns) |
| | Add stats columns to the column list if needed.
|
| |
Read manifest entries from a manifest file.
Implementations must override EntriesStream() and LiveEntriesStream(), returning self-contained streams that may outlive the reader. Entries() and LiveEntries() collect these streams into vectors.
◆ Entries()
Read all manifest entries in the manifest file.
Collects EntriesStream() into a vector.
◆ EntriesStream()
Lazily read manifest entries.
The returned stream is fallible and single-pass. It must own all resources required for consumption and must not depend on this reader remaining alive.
◆ FilterPartitions()
Filter manifest entries by partition filter.
- Note
- Unlike the Java implementation, this method does not combine new expressions with existing ones. Each call replaces the previous partition filter.
◆ FilterRows()
Filter manifest entries by row-level filter.
- Note
- Unlike the Java implementation, this method does not combine new expressions with existing ones. Each call replaces the previous row filter.
◆ LiveEntries()
◆ LiveEntriesStream()
Lazily read only live (non-deleted) manifest entries.
The returned stream is fallible and single-pass. It must own all resources required for consumption and must not depend on this reader remaining alive.
◆ Make() [1/3]
| static Result< std::unique_ptr< ManifestReader > > iceberg::ManifestReader::Make |
( |
const ManifestFile & |
manifest, |
|
|
std::shared_ptr< FileIO > |
file_io, |
|
|
std::shared_ptr< Schema > |
schema, |
|
|
const std::unordered_map< int32_t, std::shared_ptr< PartitionSpec > > & |
specs_by_id, |
|
|
bool |
is_committed = true |
|
) |
| |
|
static |
Creates a reader for a manifest file using specs keyed by ID.
- Parameters
-
| manifest | A ManifestFile object containing metadata about the manifest. |
| file_io | File IO implementation to use. |
| schema | Schema used to bind the partition type. |
| specs_by_id | Mapping of partition spec ID to PartitionSpec. |
| is_committed | Whether the manifest was committed by an older snapshot. |
- Returns
- A Result containing the reader or an error.
◆ Make() [2/3]
Creates a reader for a manifest file.
- Parameters
-
| manifest | A ManifestFile object containing metadata about the manifest. |
| file_io | File IO implementation to use. |
| schema | Schema used to bind the partition type. |
| spec | Partition spec used for this manifest file. |
| is_committed | Whether the manifest was committed by an older snapshot. |
- Returns
- A Result containing the reader or an error.
◆ Make() [3/3]
| static Result< std::unique_ptr< ManifestReader > > iceberg::ManifestReader::Make |
( |
std::string_view |
manifest_location, |
|
|
std::optional< int64_t > |
manifest_length, |
|
|
std::shared_ptr< FileIO > |
file_io, |
|
|
std::shared_ptr< Schema > |
schema, |
|
|
std::shared_ptr< PartitionSpec > |
spec, |
|
|
std::unique_ptr< InheritableMetadata > |
inheritable_metadata, |
|
|
std::optional< int64_t > |
first_row_id = std::nullopt, |
|
|
bool |
is_committed = true |
|
) |
| |
|
static |
Creates a reader for a manifest file.
- Parameters
-
| manifest_location | Path to the manifest file. |
| manifest_length | Length of the manifest file. |
| file_io | File IO implementation to use. |
| schema | Schema used to bind the partition type. |
| spec | Partition spec used for this manifest file. |
| inheritable_metadata | Inheritable metadata. |
| first_row_id | First row ID to use for the manifest entries. |
| is_committed | Whether the manifest was committed by an older snapshot. |
- Returns
- A Result containing the reader or an error.
◆ Select()
| virtual ManifestReader & iceberg::ManifestReader::Select |
( |
const std::vector< std::string > & |
columns | ) |
|
|
pure virtual |
Select specific columns of data file to read from the manifest entries.
- Note
- Column names should match the names in
DataFile schema. Unmatched names will be ignored.
-
An empty list selects no user columns. A list containing
* selects all columns. If this method is not called, all columns are selected.
◆ ShouldDropStats()
| static bool iceberg::ManifestReader::ShouldDropStats |
( |
const std::vector< std::string > & |
columns | ) |
|
|
static |
Determine whether stats should be dropped based on selected columns.
Returns true if the selected columns do not include any stats columns, or only include record_count (which is a primitive, not a large map).
The documentation for this class was generated from the following file: