Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-6274

[Rust] [DataFusion] Add support for writing results to CSV

    XMLWordPrintableJSON

    Details

      Description

      There is currently no simple way to result query results to CSV. It would be good to have convenience methods either in ExecutionContext or separate utility methods to enable results to be written in CSV format to stdout or to a file.

      There is sample code in unit tests for this and the approach is to iterate over each row in a batch and then iterate over each column and downcast it to an appropriate type (based on the schema associated with the batch) and then pull out the value for the row.

      See https://github.com/apache/arrow/blob/master/rust/datafusion/tests/sql.rs#L425-L497 for example code in a test

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hengruo Hengruo Zhang
                Reporter:
                andygrove Andy Grove
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2.5h
                  2.5h