joe-ucp commented on code in PR #8894:
URL: https://github.com/apache/arrow-rs/pull/8894#discussion_r2572606637
##########
parquet/src/file/metadata/writer.rs:
##########
@@ -149,20 +149,9 @@ impl<'a, W: Write> ThriftMetadataWriter<'a, W> {
.is_some_and(|ci| ci.iter().all(|cii| cii.iter().all(|idx|
idx.is_none())));
// transform from Option<Vec<Vec<Option<ColumnIndexMetaData>>>> to
- // Option<Vec<Vec<ColumnIndexMetaData>>>
- let column_indexes: Option<ParquetColumnIndex> = if all_none {
- None
- } else {
- column_indexes.map(|ovvi| {
- ovvi.into_iter()
- .map(|vi| {
- vi.into_iter()
- .map(|ci| ci.unwrap_or(ColumnIndexMetaData::NONE))
- .collect()
- })
- .collect()
- })
- };
+ // Option<Vec<Vec<Option<ColumnIndexMetaData>>>>
+ let column_indexes: Option<ParquetColumnIndex> =
+ if all_none { None } else { column_indexes };
Review Comment:
### Column Index Path Return Value Update
The column index path now returns:
```rust
Ok(if all_none { None } else { column_indexes })
```
- If `all_none` is `true`, returns `Ok(None)`.
- Otherwise, returns `Ok(column_indexes)`.
This makes the return value more explicit and clear.
--
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]