Skip to content

Commit 7701457

Browse files
committed
rebase and resolve conflicts
1 parent 3f22e26 commit 7701457

File tree

5 files changed

+19
-25
lines changed

5 files changed

+19
-25
lines changed

src/iceberg/data/data_writer.cc

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
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

2829
namespace 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;

src/iceberg/data/equality_delete_writer.cc

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,12 @@ class EqualityDeleteWriter::Impl {
4444
return std::unique_ptr<Impl>(new Impl(std::move(options), std::move(writer)));
4545
}
4646

47-
Status Write(ArrowArray* data) {
48-
ICEBERG_DCHECK(writer_, "Writer not initialized");
49-
return writer_->Write(data);
50-
}
47+
Status Write(ArrowArray* data) { return writer_->Write(data); }
5148

52-
Result<int64_t> Length() const {
53-
ICEBERG_DCHECK(writer_, "Writer not initialized");
54-
return writer_->length();
55-
}
49+
Result<int64_t> Length() const { return writer_->length(); }
5650

5751
Status Close() {
58-
ICEBERG_DCHECK(writer_, "Writer not initialized");
5952
if (closed_) {
60-
// Idempotent: no-op if already closed
6153
return {};
6254
}
6355
ICEBERG_RETURN_UNEXPECTED(writer_->Close());
@@ -84,6 +76,7 @@ class EqualityDeleteWriter::Impl {
8476
upper_bounds_map[col_id] = std::move(serialized);
8577
}
8678

79+
// TODO(anyone): add encryption key metadata for encrypted delete files
8780
auto data_file = std::make_shared<DataFile>(DataFile{
8881
.content = DataFile::Content::kEqualityDeletes,
8982
.file_path = options_.path,

src/iceberg/data/equality_delete_writer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct ICEBERG_EXPORT EqualityDeleteWriterOptions {
5050
std::vector<int32_t> equality_field_ids;
5151
std::optional<int32_t> sort_order_id;
5252
std::unordered_map<std::string, std::string> properties;
53-
// TODO: add key_metadata for encryption
53+
// TODO(anyone): add key_metadata for encryption
5454
};
5555

5656
/// \brief Writer for Iceberg equality delete files.

src/iceberg/data/position_delete_writer.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "iceberg/file_writer.h"
3131
#include "iceberg/manifest/manifest_entry.h"
3232
#include "iceberg/metadata_columns.h"
33+
#include "iceberg/partition_spec.h"
3334
#include "iceberg/schema.h"
3435
#include "iceberg/schema_internal.h"
3536
#include "iceberg/util/macros.h"
@@ -154,6 +155,8 @@ class PositionDeleteWriter::Impl {
154155
.split_offsets = std::move(split_offsets),
155156
.sort_order_id = std::nullopt,
156157
.referenced_data_file = std::move(referenced_data_file),
158+
.partition_spec_id =
159+
options_.spec ? std::make_optional(options_.spec->spec_id()) : std::nullopt,
157160
});
158161

159162
FileWriter::WriteResult result;

src/iceberg/type_fwd.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,22 @@ class ManifestEvaluator;
142142
class ResidualEvaluator;
143143
class StrictMetricsEvaluator;
144144

145-
/// \brief Scan.
145+
/// \brief Scan task.
146146
class ChangelogScanTask;
147-
class DataTableScan;
148147
class FileScanTask;
148+
class ScanTask;
149+
150+
/// \brief Table scan
151+
class DataTableScan;
149152
template <typename ScanTaskType>
150153
class IncrementalScan;
151154
class IncrementalAppendScan;
152155
class IncrementalChangelogScan;
153-
class ScanTask;
154156
class TableScan;
157+
158+
/// \brief Scan builder.
155159
template <typename ScanType>
156160
class TableScanBuilder;
157-
158-
// Type aliases for incremental scan builders
159161
using DataTableScanBuilder = TableScanBuilder<DataTableScan>;
160162
using IncrementalAppendScanBuilder = TableScanBuilder<IncrementalAppendScan>;
161163
using IncrementalChangelogScanBuilder = TableScanBuilder<IncrementalChangelogScan>;

0 commit comments

Comments
 (0)