62 std::optional<int64_t> data_sequence_number = std::nullopt);
78 int64_t data_sequence_number,
79 std::optional<int64_t> file_sequence_number = std::nullopt);
95 std::optional<int64_t> file_sequence_number = std::nullopt);
136 int8_t format_version, std::optional<int64_t> snapshot_id,
137 std::string_view manifest_location, std::shared_ptr<FileIO> file_io,
138 std::shared_ptr<PartitionSpec> partition_spec,
139 std::shared_ptr<Schema> current_schema,
141 std::optional<int64_t> first_row_id = std::nullopt);
147 std::unique_ptr<class ManifestEntryAdapter> adapter,
148 std::string_view manifest_location, std::optional<int64_t> first_row_id);
152 static constexpr int64_t kBatchSize = 1024;
153 std::unique_ptr<Writer> writer_;
154 std::unique_ptr<class ManifestEntryAdapter> adapter_;
156 std::string manifest_location_;
157 std::optional<int64_t> first_row_id_;
159 int32_t add_files_count_{0};
160 int32_t existing_files_count_{0};
161 int32_t delete_files_count_{0};
162 int64_t add_rows_count_{0L};
163 int64_t existing_rows_count_{0L};
164 int64_t delete_rows_count_{0L};
165 std::optional<int64_t> min_sequence_number_{std::nullopt};
166 std::unique_ptr<PartitionSummary> partition_summary_;
206 int8_t format_version, int64_t snapshot_id,
207 std::optional<int64_t> parent_snapshot_id, std::string_view manifest_list_location,
208 std::shared_ptr<FileIO> file_io,
209 std::optional<int64_t> sequence_number = std::nullopt,
210 std::optional<int64_t> first_row_id = std::nullopt);
216 std::unique_ptr<class ManifestFileAdapter> adapter);
218 static constexpr int64_t kBatchSize = 1024;
219 std::unique_ptr<Writer> writer_;
220 std::unique_ptr<class ManifestFileAdapter> adapter_;
Write manifest files to a manifest list file.
Definition manifest_writer.h:174
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...
Definition expected.h:1199
Define symbol visibility macros for core Iceberg APIs.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:34
ManifestContent
The type of files tracked by the manifest, either data or delete files; 0 for all v1 manifests.
Definition manifest_list.h:78
std::function< Result< std::unique_ptr< ManifestWriter > >(int32_t spec_id, ManifestContent content)> ManifestWriterFactory
Factory type for creating ManifestWriter instances.
Definition manifest_writer.h:171
Define Result, Status, and error helpers.
DataFile carries data file path, partition tuple, metrics, ...
Definition manifest_entry.h:63
A manifest is an immutable Avro file that lists data files or delete files, along with each file's pa...
Definition manifest_entry.h:319
Entry in a manifest list.
Definition manifest_list.h:86