tustvold commented on code in PR #2254:
URL: https://github.com/apache/arrow-rs/pull/2254#discussion_r934366110


##########
parquet/src/arrow/arrow_reader.rs:
##########
@@ -729,6 +730,87 @@ mod tests {
         }
     }
 
+    #[test]
+    fn test_decimal_nullable_struct() {
+        let decimals = Decimal128Array::from_iter_values([1, 2, 3, 4, 5, 6, 7, 
8]);
+
+        let data = ArrayDataBuilder::new(ArrowDataType::Struct(vec![Field::new(
+            "decimals",
+            decimals.data_type().clone(),
+            false,
+        )]))
+        .len(8)
+        .null_bit_buffer(Some(Buffer::from(&[0b11101111])))
+        .child_data(vec![decimals.into_data()])
+        .build()
+        .unwrap();
+
+        let written = RecordBatch::try_from_iter([(
+            "struct",
+            Arc::new(StructArray::from(data)) as ArrayRef,
+        )])
+        .unwrap();
+
+        let mut buffer = Vec::with_capacity(1024);
+        let mut writer =
+            ArrowWriter::try_new(&mut buffer, written.schema(), None).unwrap();
+        writer.write(&written).unwrap();
+        writer.close().unwrap();
+
+        let read = ParquetFileArrowReader::try_new(Bytes::from(buffer))
+            .unwrap()
+            .get_record_reader(3)
+            .unwrap()
+            .collect::<ArrowResult<Vec<_>>>()
+            .unwrap();
+
+        assert_eq!(&written.slice(0, 3), &read[0]);
+        assert_eq!(&written.slice(3, 3), &read[1]);
+        assert_eq!(&written.slice(6, 2), &read[2]);
+    }
+
+    #[test]
+    #[ignore] // https://github.com/apache/arrow-rs/issues/2253

Review Comment:
   Perhaps unsurprisingly, this is broken. :sweat_smile: 



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