joe-ucp commented on code in PR #8894:
URL: https://github.com/apache/arrow-rs/pull/8894#discussion_r2572607608


##########
parquet/src/file/metadata/writer.rs:
##########
@@ -181,16 +170,8 @@ impl<'a, W: Write> ThriftMetadataWriter<'a, W> {
             .as_ref()
             .is_some_and(|oi| oi.iter().all(|oii| oii.iter().all(|idx| 
idx.is_none())));
 
-        let offset_indexes: Option<ParquetOffsetIndex> = if all_none {
-            None
-        } else {
-            // FIXME(ets): this will panic if there's a missing index.
-            offset_indexes.map(|ovvi| {
-                ovvi.into_iter()
-                    .map(|vi| vi.into_iter().map(|oi| oi.unwrap()).collect())
-                    .collect()
-            })
-        };
+        let offset_indexes: Option<ParquetOffsetIndex> =
+            if all_none { None } else { offset_indexes };

Review Comment:
   ### Offset Index Path Return Value Update
   
   The offset index path now also returns:
   
   ```rust
   Ok(if all_none { None } else { offset_indexes })
   ```
   
   - If `all_none` is `true`, returns `Ok(None)`.
   - Otherwise, returns `Ok(offset_indexes)`.
   
   This provides consistency and clarity in the return values.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to