Dysprosium0626 commented on code in PR #261: URL: https://github.com/apache/iceberg-rust/pull/261#discussion_r1533718813
########## crates/iceberg/src/spec/schema.rs: ########## @@ -642,6 +644,199 @@ impl SchemaVisitor for IndexByName { } } +struct PruneColumn { + selected: HashSet<i32>, + select_full_types: bool, +} + +impl PruneColumn { + fn new(selected: HashSet<i32>, select_full_types: bool) -> Self { + Self { + selected, + select_full_types, + } + } + + fn project_selected_struct(projected_field: Option<Type>) -> Result<StructType> { + match projected_field { + // If the field is a StructType, return it as such + Some(field) if field.is_struct() => Ok(field.as_struct_type().unwrap_or_default()), + // If projected_field is None or not a StructType, return an empty StructType + _ => Ok(StructType::default()), + } + } + fn project_list(list: &ListType, result: Option<Type>) -> Result<ListType> { Review Comment: I see! If there are no scenarios where result would be `None`, then there is no need to use `Option<Type>`, right? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org