You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "emcake (via GitHub)" <gi...@apache.org> on 2023/02/22 14:21:53 UTC

[GitHub] [arrow-rs] emcake opened a new issue, #3748: Slicing list arrays doesn't respect the list contents

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

   **Describe the bug**
   Same idea as #3496 - slicing a record-batch with a list array inside doesn't correctly take into account the offset.
   
   **To Reproduce**
   This test will reproduce:
   
   ```rust
   
       #[test]
       fn encode_lists() {
           let val_inner = Field::new("item", DataType::UInt32, true);
           let val_list_field = Field::new("val", DataType::List(Box::new(val_inner)), false);
   
           let schema = Arc::new(Schema::new(vec![val_list_field]));
   
           let values = {
               let u32 = UInt32Builder::new();
               let mut ls = ListBuilder::new(u32);
   
               for list in vec![vec![1u32, 2, 3], vec![4, 5, 6], vec![7, 8, 9, 10]] {
                   for value in list {
                       ls.values().append_value(value);
                   }
                   ls.append(true)
               }
   
               ls.finish()
           };
   
           let batch = RecordBatch::try_new(Arc::clone(&schema), vec![Arc::new(values)]).unwrap();
           let batch = batch.slice(1, 1);
   
           let mut writer = FileWriter::try_new(Vec::<u8>::new(), &schema).unwrap();
           writer.write(&batch).unwrap();
           writer.finish().unwrap();
           let data = writer.into_inner().unwrap();
   
           let mut reader = FileReader::try_new(Cursor::new(data), None).unwrap();
           let batch2 = reader.next().unwrap().unwrap();
           assert_eq!(batch, batch2);
       }
   ```
   
   **Expected behavior**
   The sliced record batch should match its roundtrip.


-- 
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-unsubscribe@arrow.apache.org.apache.org

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


[GitHub] [arrow-rs] alamb closed issue #3748: IPC Writer Fails to Account for Sliced ListArray

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #3748: IPC Writer Fails to Account for Sliced ListArray
URL: https://github.com/apache/arrow-rs/issues/3748


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-rs] tustvold commented on issue #3748: IPC Writer Fails to Account for Sliced ListArray

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on issue #3748:
URL: https://github.com/apache/arrow-rs/issues/3748#issuecomment-1552715514

   `label_issue.py` automatically added labels {'arrow'} from #4186


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-rs] tustvold commented on issue #3748: Slicing list arrays doesn't respect the list contents

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on issue #3748:
URL: https://github.com/apache/arrow-rs/issues/3748#issuecomment-1440503614

   This sounds like https://github.com/apache/arrow-rs/issues/2080


-- 
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-unsubscribe@arrow.apache.org

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