@@ -237,81 +237,79 @@ Status ManifestEntryAdapter::AppendMap(
237237
238238Status ManifestEntryAdapter::AppendDataFile (
239239 ArrowArray* arrow_array, const std::shared_ptr<StructType>& data_file_type,
240- const std::shared_ptr< DataFile> & file) {
240+ const DataFile& file) {
241241 auto fields = data_file_type->fields ();
242242 for (int32_t i = 0 ; i < fields.size (); i++) {
243243 const auto & field = fields[i];
244244 auto array = arrow_array->children [i];
245245
246246 switch (field.field_id ()) {
247247 case 134 : // content (optional int32)
248- ICEBERG_RETURN_UNEXPECTED (
249- AppendField (array, static_cast <int64_t >(file->content )));
248+ ICEBERG_RETURN_UNEXPECTED (AppendField (array, static_cast <int64_t >(file.content )));
250249 break ;
251250 case 100 : // file_path (required string)
252- ICEBERG_RETURN_UNEXPECTED (AppendField (array, file-> file_path ));
251+ ICEBERG_RETURN_UNEXPECTED (AppendField (array, file. file_path ));
253252 break ;
254253 case 101 : // file_format (required string)
255- ICEBERG_RETURN_UNEXPECTED (AppendField (array, ToString (file-> file_format )));
254+ ICEBERG_RETURN_UNEXPECTED (AppendField (array, ToString (file. file_format )));
256255 break ;
257256 case 102 : // partition (required struct)
258257 {
259258 auto partition_type = internal::checked_pointer_cast<StructType>(field.type ());
260- ICEBERG_RETURN_UNEXPECTED (
261- AppendPartition (array, partition_type, file->partition ));
259+ ICEBERG_RETURN_UNEXPECTED (AppendPartition (array, partition_type, file.partition ));
262260 } break ;
263261 case 103 : // record_count (required int64)
264- ICEBERG_RETURN_UNEXPECTED (AppendField (array, file-> record_count ));
262+ ICEBERG_RETURN_UNEXPECTED (AppendField (array, file. record_count ));
265263 break ;
266264 case 104 : // file_size_in_bytes (required int64)
267- ICEBERG_RETURN_UNEXPECTED (AppendField (array, file-> file_size_in_bytes ));
265+ ICEBERG_RETURN_UNEXPECTED (AppendField (array, file. file_size_in_bytes ));
268266 break ;
269267 case 105 : // block_size_in_bytes (compatible in v1)
270268 // always 64MB for v1
271269 ICEBERG_RETURN_UNEXPECTED (AppendField (array, kBlockSizeInBytesV1 ));
272270 break ;
273271 case 108 : // column_sizes (optional map)
274- ICEBERG_RETURN_UNEXPECTED (AppendMap (array, file-> column_sizes ));
272+ ICEBERG_RETURN_UNEXPECTED (AppendMap (array, file. column_sizes ));
275273 break ;
276274 case 109 : // value_counts (optional map)
277- ICEBERG_RETURN_UNEXPECTED (AppendMap (array, file-> value_counts ));
275+ ICEBERG_RETURN_UNEXPECTED (AppendMap (array, file. value_counts ));
278276 break ;
279277 case 110 : // null_value_counts (optional map)
280- ICEBERG_RETURN_UNEXPECTED (AppendMap (array, file-> null_value_counts ));
278+ ICEBERG_RETURN_UNEXPECTED (AppendMap (array, file. null_value_counts ));
281279 break ;
282280 case 137 : // nan_value_counts (optional map)
283- ICEBERG_RETURN_UNEXPECTED (AppendMap (array, file-> nan_value_counts ));
281+ ICEBERG_RETURN_UNEXPECTED (AppendMap (array, file. nan_value_counts ));
284282 break ;
285283 case 125 : // lower_bounds (optional map)
286- ICEBERG_RETURN_UNEXPECTED (AppendMap (array, file-> lower_bounds ));
284+ ICEBERG_RETURN_UNEXPECTED (AppendMap (array, file. lower_bounds ));
287285 break ;
288286 case 128 : // upper_bounds (optional map)
289- ICEBERG_RETURN_UNEXPECTED (AppendMap (array, file-> upper_bounds ));
287+ ICEBERG_RETURN_UNEXPECTED (AppendMap (array, file. upper_bounds ));
290288 break ;
291289 case 131 : // key_metadata (optional binary)
292- if (!file-> key_metadata .empty ()) {
293- ICEBERG_RETURN_UNEXPECTED (AppendField (array, file-> key_metadata ));
290+ if (!file. key_metadata .empty ()) {
291+ ICEBERG_RETURN_UNEXPECTED (AppendField (array, file. key_metadata ));
294292 } else {
295293 ICEBERG_NANOARROW_RETURN_IF_NOT_OK (ArrowArrayAppendNull (array, 1 ));
296294 }
297295 break ;
298296 case 132 : // split_offsets (optional list)
299- ICEBERG_RETURN_UNEXPECTED (AppendList (array, file-> split_offsets ));
297+ ICEBERG_RETURN_UNEXPECTED (AppendList (array, file. split_offsets ));
300298 break ;
301299 case 135 : // equality_ids (optional list)
302- ICEBERG_RETURN_UNEXPECTED (AppendList (array, file-> equality_ids ));
300+ ICEBERG_RETURN_UNEXPECTED (AppendList (array, file. equality_ids ));
303301 break ;
304302 case 140 : // sort_order_id (optional int32)
305- if (file-> sort_order_id .has_value ()) {
303+ if (file. sort_order_id .has_value ()) {
306304 ICEBERG_RETURN_UNEXPECTED (
307- AppendField (array, static_cast <int64_t >(file-> sort_order_id .value ())));
305+ AppendField (array, static_cast <int64_t >(file. sort_order_id .value ())));
308306 } else {
309307 ICEBERG_NANOARROW_RETURN_IF_NOT_OK (ArrowArrayAppendNull (array, 1 ));
310308 }
311309 break ;
312310 case 142 : // first_row_id (optional int64)
313- if (file-> first_row_id .has_value ()) {
314- ICEBERG_RETURN_UNEXPECTED (AppendField (array, file-> first_row_id .value ()));
311+ if (file. first_row_id .has_value ()) {
312+ ICEBERG_RETURN_UNEXPECTED (AppendField (array, file. first_row_id .value ()));
315313 } else {
316314 ICEBERG_NANOARROW_RETURN_IF_NOT_OK (ArrowArrayAppendNull (array, 1 ));
317315 }
@@ -327,16 +325,16 @@ Status ManifestEntryAdapter::AppendDataFile(
327325 break ;
328326 }
329327 case 144 : // content_offset (optional int64)
330- if (file-> content_offset .has_value ()) {
331- ICEBERG_RETURN_UNEXPECTED (AppendField (array, file-> content_offset .value ()));
328+ if (file. content_offset .has_value ()) {
329+ ICEBERG_RETURN_UNEXPECTED (AppendField (array, file. content_offset .value ()));
332330 } else {
333331 ICEBERG_NANOARROW_RETURN_IF_NOT_OK (ArrowArrayAppendNull (array, 1 ));
334332 }
335333 break ;
336334 case 145 : // content_size_in_bytes (optional int64)
337- if (file-> content_size_in_bytes .has_value ()) {
335+ if (file. content_size_in_bytes .has_value ()) {
338336 ICEBERG_RETURN_UNEXPECTED (
339- AppendField (array, file-> content_size_in_bytes .value ()));
337+ AppendField (array, file. content_size_in_bytes .value ()));
340338 } else {
341339 ICEBERG_NANOARROW_RETURN_IF_NOT_OK (ArrowArrayAppendNull (array, 1 ));
342340 }
@@ -355,23 +353,22 @@ Result<std::optional<int64_t>> ManifestEntryAdapter::GetSequenceNumber(
355353}
356354
357355Result<std::optional<std::string>> ManifestEntryAdapter::GetReferenceDataFile (
358- const std::shared_ptr< DataFile> & file) {
359- return file-> referenced_data_file ;
356+ const DataFile& file) {
357+ return file. referenced_data_file ;
360358}
361359
362- Result<std::optional<int64_t >> ManifestEntryAdapter::GetFirstRowId (
363- const std::shared_ptr<DataFile>& file) {
364- return file->first_row_id ;
360+ Result<std::optional<int64_t >> ManifestEntryAdapter::GetFirstRowId (const DataFile& file) {
361+ return file.first_row_id ;
365362}
366363
367364Result<std::optional<int64_t >> ManifestEntryAdapter::GetContentOffset (
368- const std::shared_ptr< DataFile> & file) {
369- return file-> content_offset ;
365+ const DataFile& file) {
366+ return file. content_offset ;
370367}
371368
372369Result<std::optional<int64_t >> ManifestEntryAdapter::GetContentSizeInBytes (
373- const std::shared_ptr< DataFile> & file) {
374- return file-> content_size_in_bytes ;
370+ const DataFile& file) {
371+ return file. content_size_in_bytes ;
375372}
376373
377374Status ManifestEntryAdapter::AppendInternal (const ManifestEntry& entry) {
@@ -397,7 +394,7 @@ Status ManifestEntryAdapter::AppendInternal(const ManifestEntry& entry) {
397394 // Get the data file type from the field
398395 auto data_file_type = internal::checked_pointer_cast<StructType>(field.type ());
399396 ICEBERG_RETURN_UNEXPECTED (
400- AppendDataFile (array, data_file_type, entry.data_file ));
397+ AppendDataFile (array, data_file_type, * entry.data_file ));
401398 } else {
402399 return InvalidManifest (" Missing required data file field." );
403400 }
0 commit comments