tustvold opened a new issue, #4459:
URL: https://github.com/apache/arrow-rs/issues/4459

   **Describe the bug**
   <!--
   A clear and concise description of what the bug is.
   -->
   
   Writing a column consisting solely of all nulls results in an empty offset 
index for that column
   
   ```
   #[test]
   fn test_writer_all_null() {
       let a = Int32Array::from(vec![1, 2, 3, 4, 5]);
       let b = Int32Array::new(vec![0; 5].into(), 
Some(NullBuffer::new_null(5)));
       let batch = RecordBatch::try_from_iter(vec![
           ("a", Arc::new(a) as ArrayRef),
           ("b", Arc::new(b) as ArrayRef),
       ])
       .unwrap();
   
       let mut buf = Vec::with_capacity(1024);
       let mut writer = ArrowWriter::try_new(&mut buf, batch.schema(), 
None).unwrap();
       writer.write(&batch).unwrap();
       writer.close().unwrap();
   
       let bytes = Bytes::from(buf);
       let options = ReadOptionsBuilder::new().with_page_index().build();
       let reader = SerializedFileReader::new_with_options(bytes, 
options).unwrap();
       let index = reader.metadata().offset_index().unwrap();
   
       assert_eq!(index.len(), 1);
       assert_eq!(index[0].len(), 2); // 2 columns
       assert_eq!(index[0][0].len(), 1); // 1 page
       assert_eq!(index[0][1].len(), 1); // 1 page
   }
   ```
   
   This appears to have been a bug introduced by 
https://github.com/apache/arrow-rs/pull/4389
   
   In particular - 
https://github.com/apache/arrow-rs/pull/4389/files#diff-b1859e4da1d85e57a4185dc407458ac83a369dac132285689c27e878e3695ad6R695
   
   **To Reproduce**
   <!--
   Steps to reproduce the behavior:
   -->
   
   **Expected behavior**
   <!--
   A clear and concise description of what you expected to happen.
   -->
   
   **Additional context**
   <!--
   Add any other context about the problem here.
   -->


-- 
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: github-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to