silence-coding commented on issue #1967:
URL: 
https://github.com/apache/arrow-datafusion/issues/1967#issuecomment-1080647173


   The error cause is that the API is incorrectly used. You should use while 
let Some here.
   ```
       let mut record_batches = df.execute_stream().await?;
       // create a plan to run a SQL query
       let fieds = df.schema().fields();
   //  should use while let Some here.
       for record in record_batches.next().await {
           let record = record.unwrap();
           let rows = record.num_rows();
           let cols = record.num_columns();
           for row in 0..rows {
               for col in 0..cols {
                   let data = array_value_to_string(record.column(col), 
row).unwrap();
                   print!("{}: {:?}, ", fieds[col].name(), data);
               }
               println!();
           }
       }
   ```


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