@@ -192,78 +192,57 @@ struct ICEBERG_EXPORT DataFile {
192192 // / present
193193 std::optional<int64_t > content_size_in_bytes;
194194
195- inline static const SchemaField kContent =
196- SchemaField::MakeRequired (134 , " content" , std::make_shared<IntType>());
195+ inline static const SchemaField kContent = MakeRequiredField<IntType>(134 , " content" );
197196 inline static const SchemaField kFilePath =
198- SchemaField::MakeRequired (100 , " file_path" , std::make_shared<StringType>() );
197+ MakeRequiredField<StringType> (100 , " file_path" );
199198 inline static const SchemaField kFileFormat =
200- SchemaField::MakeRequired (101 , " file_format" , std::make_shared<IntType>() );
199+ MakeRequiredField<IntType> (101 , " file_format" );
201200 inline static const SchemaField kRecordCount =
202- SchemaField::MakeRequired (103 , " record_count" , std::make_shared<LongType>() );
201+ MakeRequiredField<LongType> (103 , " record_count" );
203202 inline static const SchemaField kFileSize =
204- SchemaField::MakeRequired (104 , " file_size_in_bytes" , std::make_shared<LongType>() );
205- inline static const SchemaField kColumnSizes = SchemaField::MakeOptional (
203+ MakeRequiredField<LongType> (104 , " file_size_in_bytes" );
204+ inline static const SchemaField kColumnSizes = MakeOptionalField<MapType> (
206205 108 , " column_sizes" ,
207- std::make_shared<MapType>(
208- SchemaField::MakeRequired (117 , std::string(MapType::kKeyName ),
209- std::make_shared<IntType>()),
210- SchemaField::MakeRequired(118 , std::string(MapType::kValueName ),
211- std::make_shared<LongType>())));
212- inline static const SchemaField kValueCounts = SchemaField::MakeOptional(
206+ MakeRequiredField<IntType>(117 , std::string(MapType::kKeyName )),
207+ MakeRequiredField<LongType>(118 , std::string(MapType::kValueName )));
208+ inline static const SchemaField kValueCounts = MakeOptionalField<MapType>(
213209 109 , " value_counts" ,
214- std::make_shared<MapType>(
215- SchemaField::MakeRequired (119 , std::string(MapType::kKeyName ),
216- std::make_shared<IntType>()),
217- SchemaField::MakeRequired(120 , std::string(MapType::kValueName ),
218- std::make_shared<LongType>())));
219- inline static const SchemaField kNullValueCounts = SchemaField::MakeOptional(
210+ MakeRequiredField<IntType>(119 , std::string(MapType::kKeyName )),
211+ MakeRequiredField<LongType>(120 , std::string(MapType::kValueName )));
212+ inline static const SchemaField kNullValueCounts = MakeOptionalField<MapType>(
220213 110 , " null_value_counts" ,
221- std::make_shared<MapType>(
222- SchemaField::MakeRequired (121 , std::string(MapType::kKeyName ),
223- std::make_shared<IntType>()),
224- SchemaField::MakeRequired(122 , std::string(MapType::kValueName ),
225- std::make_shared<LongType>())));
226- inline static const SchemaField kNanValueCounts = SchemaField::MakeOptional(
214+ MakeRequiredField<IntType>(121 , std::string(MapType::kKeyName )),
215+ MakeRequiredField<LongType>(122 , std::string(MapType::kValueName )));
216+ inline static const SchemaField kNanValueCounts = MakeOptionalField<MapType>(
227217 137 , " nan_value_counts" ,
228- std::make_shared<MapType>(
229- SchemaField::MakeRequired (138 , std::string(MapType::kKeyName ),
230- std::make_shared<IntType>()),
231- SchemaField::MakeRequired(139 , std::string(MapType::kValueName ),
232- std::make_shared<LongType>())));
233- inline static const SchemaField kLowerBounds = SchemaField::MakeOptional(
218+ MakeRequiredField<IntType>(138 , std::string(MapType::kKeyName )),
219+ MakeRequiredField<LongType>(139 , std::string(MapType::kValueName )));
220+ inline static const SchemaField kLowerBounds = MakeOptionalField<MapType>(
234221 125 , " lower_bounds" ,
235- std::make_shared<MapType>(
236- SchemaField::MakeRequired (126 , std::string(MapType::kKeyName ),
237- std::make_shared<IntType>()),
238- SchemaField::MakeRequired(127 , std::string(MapType::kValueName ),
239- std::make_shared<BinaryType>())));
240- inline static const SchemaField kUpperBounds = SchemaField::MakeOptional(
222+ MakeRequiredField<IntType>(126 , std::string(MapType::kKeyName )),
223+ MakeRequiredField<BinaryType>(127 , std::string(MapType::kValueName )));
224+ inline static const SchemaField kUpperBounds = MakeOptionalField<MapType>(
241225 128 , " upper_bounds" ,
242- std::make_shared<MapType>(
243- SchemaField::MakeRequired (129 , std::string(MapType::kKeyName ),
244- std::make_shared<IntType>()),
245- SchemaField::MakeRequired(130 , std::string(MapType::kValueName ),
246- std::make_shared<BinaryType>())));
226+ MakeRequiredField<IntType>(129 , std::string(MapType::kKeyName )),
227+ MakeRequiredField<BinaryType>(130 , std::string(MapType::kValueName )));
247228 inline static const SchemaField kKeyMetadata =
248- SchemaField::MakeOptional (131 , " key_metadata" , std::make_shared<BinaryType>() );
249- inline static const SchemaField kSplitOffsets = SchemaField::MakeOptional (
229+ MakeOptionalField<BinaryType> (131 , " key_metadata" );
230+ inline static const SchemaField kSplitOffsets = MakeOptionalField<ListType> (
250231 132 , " split_offsets" ,
251- std::make_shared<ListType>(SchemaField::MakeRequired(
252- 133 , std::string(ListType::kElementName ), std::make_shared<LongType>())));
253- inline static const SchemaField kEqualityIds = SchemaField::MakeOptional(
232+ MakeRequiredField<LongType>(133 , std::string(ListType::kElementName )));
233+ inline static const SchemaField kEqualityIds = MakeOptionalField<ListType>(
254234 135 , " equality_ids" ,
255- std::make_shared<ListType>(SchemaField::MakeRequired(
256- 136 , std::string(ListType::kElementName ), std::make_shared<IntType>())));
235+ MakeRequiredField<IntType>(136 , std::string(ListType::kElementName )));
257236 inline static const SchemaField kSortOrderId =
258- SchemaField::MakeOptional (140 , " sort_order_id" , std::make_shared<IntType>() );
237+ MakeOptionalField<IntType> (140 , " sort_order_id" );
259238 inline static const SchemaField kFirstRowId =
260- SchemaField::MakeOptional (142 , " first_row_id" , std::make_shared<LongType>() );
261- inline static const SchemaField kReferencedDataFile = SchemaField::MakeOptional(
262- 143 , " referenced_data_file" , std::make_shared<StringType>() );
239+ MakeOptionalField<LongType> (142 , " first_row_id" );
240+ inline static const SchemaField kReferencedDataFile =
241+ MakeOptionalField<StringType>( 143 , " referenced_data_file" );
263242 inline static const SchemaField kContentOffset =
264- SchemaField::MakeOptional (144 , " content_offset" , std::make_shared<LongType>() );
265- inline static const SchemaField kContentSize = SchemaField::MakeOptional(
266- 145 , " content_size_in_bytes" , std::make_shared<LongType>() );
243+ MakeOptionalField<LongType> (144 , " content_offset" );
244+ inline static const SchemaField kContentSize =
245+ MakeOptionalField<LongType>( 145 , " content_size_in_bytes" );
267246
268247 static std::shared_ptr<StructType> Type (std::shared_ptr<StructType> partition_type);
269248};
@@ -292,14 +271,13 @@ struct ICEBERG_EXPORT ManifestEntry {
292271 // / File path, partition tuple, metrics, ...
293272 DataFile data_file;
294273
295- inline static const SchemaField kStatus =
296- SchemaField::MakeRequired (0 , " status" , std::make_shared<IntType>());
274+ inline static const SchemaField kStatus = MakeRequiredField<IntType>(0 , " status" );
297275 inline static const SchemaField kSnapshotId =
298- SchemaField::MakeOptional (1 , " snapshot_id" , std::make_shared<LongType>() );
276+ MakeOptionalField<LongType> (1 , " snapshot_id" );
299277 inline static const SchemaField kSequenceNumber =
300- SchemaField::MakeOptional (3 , " sequence_number" , std::make_shared<LongType>() );
278+ MakeOptionalField<LongType> (3 , " sequence_number" );
301279 inline static const SchemaField kFileSequenceNumber =
302- SchemaField::MakeOptional (4 , " file_sequence_number" , std::make_shared<LongType>() );
280+ MakeOptionalField<LongType> (4 , " file_sequence_number" );
303281
304282 static std::shared_ptr<StructType> TypeFromPartitionType (
305283 std::shared_ptr<StructType> partition_type);
0 commit comments