Generate a partitioned CSV file and register it with an execution context
(
tmp_dir: &TempDir,
partition_count: usize,
)
| 2841 | |
| 2842 | /// Generate a partitioned CSV file and register it with an execution context |
| 2843 | async fn create_ctx( |
| 2844 | tmp_dir: &TempDir, |
| 2845 | partition_count: usize, |
| 2846 | ) -> Result<SessionContext> { |
| 2847 | let ctx = SessionContext::new_with_config( |
| 2848 | SessionConfig::new().with_target_partitions(8), |
| 2849 | ); |
| 2850 | |
| 2851 | let schema = populate_csv_partitions(tmp_dir, partition_count, ".csv")?; |
| 2852 | |
| 2853 | // register csv file with the execution context |
| 2854 | ctx.register_csv( |
| 2855 | "test", |
| 2856 | tmp_dir.path().to_str().unwrap(), |
| 2857 | CsvReadOptions::new().schema(&schema), |
| 2858 | ) |
| 2859 | .await?; |
| 2860 | |
| 2861 | Ok(ctx) |
| 2862 | } |
| 2863 | |
| 2864 | #[derive(Debug)] |
| 2865 | struct MyTypePlanner {} |
no test coverage detected
searching dependent graphs…