60 std::optional<int64_t> data_sequence_number = std::nullopt);
76 int64_t data_sequence_number,
77 std::optional<int64_t> file_sequence_number = std::nullopt);
93 std::optional<int64_t> file_sequence_number = std::nullopt);
101 Status
AddAll(
const std::vector<ManifestEntry>& entries);
134 int8_t format_version, std::optional<int64_t> snapshot_id,
135 std::string_view manifest_location, std::shared_ptr<FileIO> file_io,
136 std::shared_ptr<PartitionSpec> partition_spec,
137 std::shared_ptr<Schema> current_schema,
139 std::optional<int64_t> first_row_id = std::nullopt);
145 std::unique_ptr<class ManifestEntryAdapter> adapter,
146 std::string_view manifest_location, std::optional<int64_t> first_row_id);
148 Status CheckDataFile(
const DataFile& file)
const;
150 static constexpr int64_t kBatchSize = 1024;
151 std::unique_ptr<Writer> writer_;
152 std::unique_ptr<class ManifestEntryAdapter> adapter_;
154 std::string manifest_location_;
155 std::optional<int64_t> first_row_id_;
157 int32_t add_files_count_{0};
158 int32_t existing_files_count_{0};
159 int32_t delete_files_count_{0};
160 int64_t add_rows_count_{0L};
161 int64_t existing_rows_count_{0L};
162 int64_t delete_rows_count_{0L};
163 std::optional<int64_t> min_sequence_number_{std::nullopt};
164 std::unique_ptr<PartitionSummary> partition_summary_;
184 Status
AddAll(
const std::vector<ManifestFile>& files);
204 int8_t format_version, int64_t snapshot_id,
205 std::optional<int64_t> parent_snapshot_id, std::string_view manifest_list_location,
206 std::shared_ptr<FileIO> file_io,
207 std::optional<int64_t> sequence_number = std::nullopt,
208 std::optional<int64_t> first_row_id = std::nullopt);
214 std::unique_ptr<class ManifestFileAdapter> adapter);
216 static constexpr int64_t kBatchSize = 1024;
217 std::unique_ptr<Writer> writer_;
218 std::unique_ptr<class ManifestFileAdapter> adapter_;
Write manifest files to a manifest list file.
Definition manifest_writer.h:172
Status Close()
Close writer and flush to storage.
Status AddAll(const std::vector< ManifestFile > &files)
Write manifest file list to manifest list file.
std::optional< int64_t > next_row_id() const
Get the next row id to assign.
Status Add(const ManifestFile &file)
Write manifest file to manifest list file.
static Result< std::unique_ptr< ManifestListWriter > > MakeWriter(int8_t format_version, int64_t snapshot_id, std::optional< int64_t > parent_snapshot_id, std::string_view manifest_list_location, std::shared_ptr< FileIO > file_io, std::optional< int64_t > sequence_number=std::nullopt, std::optional< int64_t > first_row_id=std::nullopt)
Factory function to create a writer for the manifest list based on format version.
Write manifest entries to a manifest file.
Definition manifest_writer.h:40
Status WriteAddedEntry(std::shared_ptr< DataFile > file, std::optional< int64_t > data_sequence_number=std::nullopt)
Add an added entry for a file with a specific sequence number.
Status WriteAddedEntry(const ManifestEntry &entry)
Add a new entry to the manifest. The method populates the snapshot id and status fields of the entry.
Status Close()
Close writer and flush to storage.
Result< Metrics > metrics() const
Get the metrics of written manifest file.
Status WriteDeletedEntry(std::shared_ptr< DataFile > file, int64_t data_sequence_number, std::optional< int64_t > file_sequence_number=std::nullopt)
Add a delete entry for a file.
Result< int64_t > length() const
Get the current length of the manifest file in bytes.
ManifestContent content() const
Get the content of the manifest.
Status WriteExistingEntry(const ManifestEntry &entry)
Add an existing entry to the manifest. The method populates the status field of the entry.
static Result< std::unique_ptr< ManifestWriter > > MakeWriter(int8_t format_version, std::optional< int64_t > snapshot_id, std::string_view manifest_location, std::shared_ptr< FileIO > file_io, std::shared_ptr< PartitionSpec > partition_spec, std::shared_ptr< Schema > current_schema, ManifestContent content=ManifestContent::kData, std::optional< int64_t > first_row_id=std::nullopt)
Factory function to create a writer for a manifest file based on format version.
Status WriteEntry(const ManifestEntry &entry)
Write the entry that all its fields are populated correctly.
Status AddAll(const std::vector< ManifestEntry > &entries)
Write manifest entries to file.
Status WriteExistingEntry(std::shared_ptr< DataFile > file, int64_t file_snapshot_id, int64_t data_sequence_number, std::optional< int64_t > file_sequence_number=std::nullopt)
Add an existing entry for a file.
Result< ManifestFile > ToManifestFile() const
Get the ManifestFile object.
Status WriteDeletedEntry(const ManifestEntry &entry)
Add a deleted entry to the manifest. The method populates the snapshot id and status fields of the en...
Define symbol visibility macros for core Iceberg APIs.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:33
ManifestContent
The type of files tracked by the manifest, either data or delete files; 0 for all v1 manifests.
Definition manifest_list.h:77
std::function< Result< std::unique_ptr< ManifestWriter > >(int32_t spec_id, ManifestContent content)> ManifestWriterFactory
Factory type for creating ManifestWriter instances.
Definition manifest_writer.h:169
std::expected< T, E > Result
Result alias.
Definition result.h:88
Define Result, Status, and error helpers.
DataFile carries data file path, partition tuple, metrics, ...
Definition manifest_entry.h:62
A manifest is an immutable Avro file that lists data files or delete files, along with each file's pa...
Definition manifest_entry.h:318
Entry in a manifest list.
Definition manifest_list.h:85