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


##########
parquet/src/file/writer.rs:
##########
@@ -1540,4 +1610,83 @@ mod tests {
         assert_eq!(s.min_value.as_deref(), Some(1_i32.to_le_bytes().as_ref()));
         assert_eq!(s.max_value.as_deref(), Some(3_i32.to_le_bytes().as_ref()));
     }
+
+    #[test]
+    fn test_spliced_write() {
+        let message_type = "
+            message test_schema {
+                REQUIRED INT32 i32 (INTEGER(32,true));
+                REQUIRED INT32 u32 (INTEGER(32,false));
+            }
+        ";
+        let schema = Arc::new(parse_message_type(message_type).unwrap());
+        let props = Arc::new(WriterProperties::builder().build());
+
+        let mut file = Vec::with_capacity(1024);
+        let mut file_writer =
+            SerializedFileWriter::new(&mut file, schema, 
props.clone()).unwrap();
+
+        let columns = file_writer.descr.columns();
+        let mut column_state: Vec<(_, Option<ColumnCloseResult>)> = columns
+            .iter()
+            .map(|_| (TrackedWrite::new(Vec::with_capacity(1024)), None))
+            .collect();
+
+        let mut column_state_slice = column_state.as_mut_slice();
+        let mut column_writers = Vec::with_capacity(columns.len());
+        for c in columns {
+            let ((buf, out), tail) = 
column_state_slice.split_first_mut().unwrap();

Review Comment:
   This is somewhat obtuse, but is necessary to make the lifetimes work



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