gruuya commented on issue #6412:
URL: https://github.com/apache/arrow-rs/issues/6412#issuecomment-2678325269

   I'm not convinced that this issue has actually been resolved (or at least I 
need to open a new one?).
   
   Basically, I'd like to be able to round-trip a lonely empty record batch, 
for the purpose of creating a table in advance for some actual up-coming data, 
but that doesn't work atm:
   ```rust
       #[tokio::test]
       async fn test_empty_batch_round_trip() {
           let schema = Schema::new(vec![Field::new("data", DataType::Int32, 
false)]);
           let empty_batch = RecordBatch::new_empty(Arc::new(schema));
           let stream = FlightDataEncoderBuilder::new()
               .build(futures::stream::iter(vec![Ok(empty_batch.clone())]));
   
           let data: Vec<RecordBatch> = 
FlightRecordBatchStream::new_from_flight_data(stream)
               .try_collect()
               .await
               .unwrap();
   
           assert_eq!(data, vec![empty_batch]);
       }
   ```
   This test currently fails, as the decoded data vector is empty.
   
   I've identified the issue to be in `split_batch_for_grpc_response` which for 
an empty record batch returns no batch to be queued up (instead of that sole 
batch), so the fix seems pretty simple 
https://github.com/apache/arrow-rs/pull/7188


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