alamb commented on code in PR #6649:
URL: https://github.com/apache/arrow-rs/pull/6649#discussion_r1825106589


##########
parquet/src/record/reader.rs:
##########
@@ -1688,6 +1698,131 @@ mod tests {
         assert_eq!(rows, expected_rows);
     }
 
+    #[test]
+    fn test_tree_reader_handle_primitive_repeated_fields_with_no_annotation() {

Review Comment:
   I ran these tests without the change in this PR and it failed like this. 
Thus I conclude this test covers the code change
   
   ```
   
   assertion `left == right` failed
     left: [Row { fields: [("Int32_list", Int(0)), ("String_list", Str("foo")), 
("group_of_lists", Group(Row { fields: [("Int32_list_in_group", Int(0)), 
("String_list_in_group", Str("foo"))] }))] }, Row { fields: [("Int32_list", 
Int(1)), ("String_list", Str("zero")), ("group_of_lists", Group(Row { fields: 
[("Int32_list_in_group", Int(1)), ("String_list_in_group", Str("zero"))] }))] 
}, Row { fields: [("Int32_list", Int(2)), ("String_list", Str("one")), 
("group_of_lists", Group(Row { fields: [("Int32_list_in_group", Int(2)), 
("String_list_in_group", Str("one"))] }))] }, Row { fields: [("Int32_list", 
Int(3)), ("String_list", Str("two")), ("group_of_lists", Group(Row { fields: 
[("Int32_list_in_group", Int(3)), ("String_list_in_group", Str("two"))] }))] }]
    right: [Row { fields: [("Int32_list", ListInternal(List { elements: 
[Int(0), Int(1), Int(2), Int(3)] })), ("String_list", ListInternal(List { 
elements: [Str("foo"), Str("zero"), Str("one"), Str("two")] })), 
("group_of_lists", Group(Row { fields: [("Int32_list_in_group", 
ListInternal(List { elements: [Int(0), Int(1), Int(2), Int(3)] })), 
("String_list_in_group", ListInternal(List { elements: [Str("foo"), 
Str("zero"), Str("one"), Str("two")] }))] }))] }, Row { fields: [("Int32_list", 
ListInternal(List { elements: [] })), ("String_list", ListInternal(List { 
elements: [Str("three")] })), ("group_of_lists", Group(Row { fields: 
[("Int32_list_in_group", ListInternal(List { elements: [] })), 
("String_list_in_group", ListInternal(List { elements: [Str("three")] }))] }))] 
}, Row { fields: [("Int32_list", ListInternal(List { elements: [Int(4)] })), 
("String_list", ListInternal(List { elements: [Str("four")] })), 
("group_of_lists", Group(Row { fields: [("Int32_list_in_group", ListInternal(Li
 st { elements: [Int(4)] })), ("String_list_in_group", ListInternal(List { 
elements: [Str("four")] }))] }))] }, Row { fields: [("Int32_list", 
ListInternal(List { elements: [Int(5), Int(6), Int(7), Int(8)] })), 
("String_list", ListInternal(List { elements: [Str("five"), Str("six"), 
Str("seven"), Str("eight")] })), ("group_of_lists", Group(Row { fields: 
[("Int32_list_in_group", ListInternal(List { elements: [Int(5), Int(6), Int(7), 
Int(8)] })), ("String_list_in_group", ListInternal(List { elements: 
[Str("five"), Str("six"), Str("seven"), Str("eight")] }))] }))] }]
   
   Left:  [Row { fields: [("Int32_list", Int(0)), ("String_list", Str("foo")), 
("group_of_lists", Group(Row { fields: [("Int32_list_in_group", Int(0)), 
("String_list_in_group", Str("foo"))] }))] }, Row { fields: [("Int32_list", 
Int(1)), ("String_list", Str("ze ...
   
   Right: [Row { fields: [("Int32_list", ListInternal(List { elements: [Int(0), 
Int(1), Int(2), Int(3)] })), ("String_list", ListInternal(List { elements: 
[Str("foo"), Str("zero"), Str("one"), Str("two")] })), ("group_of_lists", 
Group(Row { fields: [("Int32_li ...
   ```
   
   



##########
parquet/src/record/reader.rs:
##########
@@ -138,7 +138,17 @@ impl TreeBuilder {
                 .column_descr_ptr();
             let col_reader = row_group_reader.get_column_reader(orig_index)?;
             let column = TripletIter::new(col_descr, col_reader, 
self.batch_size);
-            Reader::PrimitiveReader(field, Box::new(column))
+            let reader = Reader::PrimitiveReader(field.clone(), 
Box::new(column));

Review Comment:
   I believe the changes in `parquet-testing` come from 
https://github.com/apache/parquet-testing/pull/61 👍 



-- 
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