nevi-me commented on a change in pull request #511:
URL: https://github.com/apache/arrow-rs/pull/511#discussion_r661194474
##########
File path: parquet/src/arrow/levels.rs
##########
@@ -334,37 +336,30 @@ impl LevelInfo {
let mut merged_array_mask = Vec::with_capacity(min_len);
let max_definition = match (self.level_type, level_type) {
- (LevelType::Root, LevelType::Struct(is_nullable)) => {
- // If the struct is non-nullable, its def level doesn't
increment
- is_nullable as i16
- }
- (LevelType::Root, _) => 1,
+ // Handle the illegal cases
(_, LevelType::Root) => {
unreachable!("Cannot have a root as a child")
}
- (LevelType::List(_), _) => {
- self.max_definition + 1 + level_type.level_increment()
- }
- (LevelType::Struct(_), _) => {
- self.max_definition + level_type.level_increment()
- }
- (_, LevelType::List(is_nullable)) => {
- // if the child is a list, even if its parent is a root
- self.max_definition + 1 + is_nullable as i16
- }
(LevelType::Primitive(_), _) => {
unreachable!("Cannot have a primitive parent for any type")
}
+ // The general case
+ (_, _) => self.max_definition + level_type.level_increment(),
};
match (self.level_type, level_type) {
(LevelType::List(_), LevelType::List(is_nullable)) => {
// parent is a list or descendant of a list, and child is a
list
let reps = self.repetition.clone().unwrap();
// Calculate the 2 list hierarchy definitions in advance
- // List is not empty, but null
- let l2 = max_definition - is_nullable as i16;
- // List is not empty, and not null
+
+ // TODO: Update this to be similar to the 1-level list
Review comment:
This TODO was because I was lazy, then ended up updating. I'll remove it
--
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]