You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/04/23 16:31:13 UTC

[GitHub] [arrow] markhildreth commented on issue #6972: ARROW-8287: [Rust] Add "pretty" util to help with printing tabular output of RecordBatches

markhildreth commented on issue #6972:
URL: https://github.com/apache/arrow/pull/6972#issuecomment-618501806


   @andygrove Thanks for the feedback. I have updated the PR with a less leaky API. I also fixed the type inference problem that was caused by the new dependency.
   
   @nevi-me True for a singular batch, but it's possible to create multiple batches from different sources. For example
   
   ```
   let schema1 = ...
   let csv1 = ...
   let batch1 = ...
   
   let schema2 = ... // different schema
   let csv2 = ...
   let batch2 = ...
   
   print_batches(&[batch1, batch2]);
   ```
   
   As I said, this is probably not something to worry about too much right now, but I'll probably add an issue for it for later if that's alright. Interestingly, this code wouldn't even necessarily crash; you would just get an odd-looking table:
   
   ```
   +---------------------------------------+-----------+-----------+-------+
   | city                                  | lat       | lng       |       |
   +---------------------------------------+-----------+-----------+-------+
   | Elgin, Scotland, the UK               | 57.653484 | -3.335724 |       |
   | Stoke-on-Trent, Staffordshire, the UK | 53.002666 | -2.179404 |       |
   | Solihull, Birmingham, UK              | 52.412811 | -1.778197 |       |
   | Cardiff, Cardiff county, UK           | 51.481583 | -3.17909  |       |
   | 1                                     | 1.1       | 1.11      | true  |
   | 2                                     | 2.2       | 2.22      | true  |
   | 3                                     | 0         | 3.33      | true  |
   | 4                                     | 4.4       |           | false |
   | 5                                     | 6.6       |           | false |
   +---------------------------------------+-----------+-----------+-------+
   
   ```


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

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