Skip to content

Commit 16e3c70

Browse files
committed
fix: resolve review comments
Signed-off-by: Junwang Zhao <[email protected]>
1 parent 1de36a3 commit 16e3c70

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

src/iceberg/manifest_entry.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
2020
#include "iceberg/manifest_entry.h"
2121

2222
#include <memory>
23-
#include <optional>
2423
#include <vector>
2524

26-
#include "iceberg/schema.h"
2725
#include "iceberg/schema_field.h"
2826
#include "iceberg/type.h"
2927

@@ -138,11 +136,11 @@ const SchemaField ManifestEntry::SEQUENCE_NUMBER =
138136
const SchemaField ManifestEntry::FILE_SEQUENCE_NUMBER =
139137
SchemaField::MakeOptional(4, "file_sequence_number", std::make_shared<LongType>());
140138

141-
Schema ManifestEntry::GetSchema(StructType partition_type) {
139+
StructType ManifestEntry::GetSchema(StructType partition_type) {
142140
return GetSchemaFromDataFileType(DataFile::GetType(partition_type));
143141
}
144142

145-
Schema ManifestEntry::GetSchemaFromDataFileType(StructType datafile_type) {
143+
StructType ManifestEntry::GetSchemaFromDataFileType(StructType datafile_type) {
146144
std::vector<SchemaField> fields;
147145

148146
fields.push_back(STATUS);
@@ -155,7 +153,7 @@ Schema ManifestEntry::GetSchemaFromDataFileType(StructType datafile_type) {
155153
2, "data_file", std::make_shared<StructType>(DataFile::GetType(datafile_type)));
156154
fields.push_back(data_file_type_field);
157155

158-
return {std::move(fields), /*schema_id=*/std::nullopt};
156+
return StructType(std::move(fields));
159157
}
160158

161159
} // namespace iceberg

src/iceberg/manifest_entry.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ struct ICEBERG_EXPORT ManifestEntry {
246246
static const SchemaField SEQUENCE_NUMBER;
247247
static const SchemaField FILE_SEQUENCE_NUMBER;
248248

249-
static Schema GetSchema(StructType partition_type);
250-
static Schema GetSchemaFromDataFileType(StructType datafile_type);
249+
static StructType GetSchema(StructType partition_type);
250+
static StructType GetSchemaFromDataFileType(StructType datafile_type);
251251
};
252252

253253
} // namespace iceberg

src/iceberg/manifest_list.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
#include "iceberg/manifest_list.h"
2121

22-
#include "iceberg/schema.h"
22+
#include <vector>
23+
24+
#include "iceberg/schema_field.h"
2325
#include "iceberg/type.h"
2426

2527
namespace iceberg {
@@ -78,7 +80,7 @@ const SchemaField ManifestFile::KEY_METADATA =
7880
const SchemaField ManifestFile::FIRST_ROW_ID =
7981
SchemaField::MakeOptional(520, "first_row_id", std::make_shared<LongType>());
8082

81-
Schema ManifestFile::schema() {
83+
StructType ManifestFile::Schema() {
8284
std::vector<SchemaField> fields;
8385
fields.push_back(MANIFEST_PATH);
8486
fields.push_back(MANIFEST_LENGTH);
@@ -97,7 +99,7 @@ Schema ManifestFile::schema() {
9799
fields.push_back(KEY_METADATA);
98100
fields.push_back(FIRST_ROW_ID);
99101

100-
return {std::move(fields), /*schema_id=*/std::nullopt};
102+
return StructType(std::move(fields));
101103
}
102104

103105
} // namespace iceberg

src/iceberg/manifest_list.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
#include "iceberg/iceberg_export.h"
3030
#include "iceberg/result.h"
31-
#include "iceberg/schema_field.h"
3231
#include "iceberg/type_fwd.h"
3332

3433
namespace iceberg {
@@ -180,7 +179,7 @@ struct ICEBERG_EXPORT ManifestFile {
180179
static const SchemaField KEY_METADATA;
181180
static const SchemaField FIRST_ROW_ID;
182181

183-
static Schema schema();
182+
static StructType Schema();
184183
};
185184

186185
/// Snapshots are embedded in table metadata, but the list of manifests for a snapshot are

0 commit comments

Comments
 (0)