tustvold commented on code in PR #1746:
URL: https://github.com/apache/arrow-rs/pull/1746#discussion_r883066519
##########
parquet/src/arrow/levels.rs:
##########
@@ -1760,63 +1145,155 @@ mod tests {
let array = Arc::new(list_builder.finish());
+ let values_len = array.data().child_data()[0].len();
+ assert_eq!(values_len, 5);
+
let schema = Arc::new(Schema::new(vec![list_field]));
let rb = RecordBatch::try_new(schema, vec![array]).unwrap();
- let batch_level = LevelInfo::new(0, rb.num_rows());
- let list_level =
- &batch_level.calculate_array_levels(rb.column(0),
rb.schema().field(0))[0];
+ let levels = calculate_array_levels(rb.column(0),
rb.schema().field(0)).unwrap();
+ let list_level = &levels[0];
let expected_level = LevelInfo {
- definition: vec![4, 1, 0, 2, 2, 3, 4],
- repetition: Some(vec![0, 0, 0, 0, 1, 0, 0]),
- array_offsets: vec![0, 1, 1, 1, 3, 4, 5],
- array_mask: vec![true, true, false, false, false, false, true],
- max_definition: 4,
- level_type: LevelType::Primitive(true),
- offset: 0,
- length: 5,
+ def_levels: Some(vec![4, 1, 0, 2, 2, 3, 4]),
+ rep_levels: Some(vec![0, 0, 0, 0, 1, 0, 0]),
+ non_null_indices: vec![0, 4],
+ max_def_level: 4,
+ max_rep_level: 1,
};
assert_eq!(list_level, &expected_level);
}
#[test]
- fn test_nested_indices() {
Review Comment:
This method no longer exists
--
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]