2323
2424#include " iceberg/file_writer.h"
2525#include " iceberg/manifest/manifest_entry.h"
26+ #include " iceberg/partition_spec.h"
2627#include " iceberg/util/macros.h"
2728
2829namespace iceberg {
@@ -43,18 +44,11 @@ class DataWriter::Impl {
4344 return std::unique_ptr<Impl>(new Impl (std::move (options), std::move (writer)));
4445 }
4546
46- Status Write (ArrowArray* data) {
47- ICEBERG_DCHECK (writer_, " Writer not initialized" );
48- return writer_->Write (data);
49- }
47+ Status Write (ArrowArray* data) { return writer_->Write (data); }
5048
51- Result<int64_t > Length () const {
52- ICEBERG_DCHECK (writer_, " Writer not initialized" );
53- return writer_->length ();
54- }
49+ Result<int64_t > Length () const { return writer_->length (); }
5550
5651 Status Close () {
57- ICEBERG_DCHECK (writer_, " Writer not initialized" );
5852 if (closed_) {
5953 // Idempotent: no-op if already closed
6054 return {};
@@ -100,6 +94,8 @@ class DataWriter::Impl {
10094 .upper_bounds = std::move (upper_bounds_map),
10195 .split_offsets = std::move (split_offsets),
10296 .sort_order_id = options_.sort_order_id ,
97+ .partition_spec_id =
98+ options_.spec ? std::make_optional (options_.spec ->spec_id ()) : std::nullopt ,
10399 });
104100
105101 FileWriter::WriteResult result;
0 commit comments