Creates a [`DataFrame`] for reading a CSV data source. For more control such as reading multiple files, you can use [`read_table`](Self::read_table) with a [`super::ListingTable`]. Example usage is given below: ``` use datafusion::prelude::*; # use datafusion::error::Result; # #[tokio::main] # async fn main() -> Result<()> { let ctx = SessionContext::new(); // You can read a single file using `
(
&self,
table_paths: P,
options: CsvReadOptions<'_>,
)
| 51 | /// # } |
| 52 | /// ``` |
| 53 | pub async fn read_csv<P: DataFilePaths>( |
| 54 | &self, |
| 55 | table_paths: P, |
| 56 | options: CsvReadOptions<'_>, |
| 57 | ) -> Result<DataFrame> { |
| 58 | self._read_type(table_paths, options).await |
| 59 | } |
| 60 | |
| 61 | /// Registers a CSV file as a table which can referenced from SQL |
| 62 | /// statements executed against this context. |