()
| 242 | |
| 243 | #[tokio::test] |
| 244 | async fn infer_schema() -> Result<()> { |
| 245 | let session_ctx = SessionContext::new(); |
| 246 | let state = session_ctx.state(); |
| 247 | |
| 248 | let projection = None; |
| 249 | let root = "./tests/data/csv"; |
| 250 | let format = CsvFormat::default().with_has_header(true); |
| 251 | let exec = scan_format( |
| 252 | &state, |
| 253 | &format, |
| 254 | None, |
| 255 | root, |
| 256 | "aggregate_test_100_with_nulls.csv", |
| 257 | projection, |
| 258 | None, |
| 259 | ) |
| 260 | .await?; |
| 261 | |
| 262 | let x: Vec<String> = exec |
| 263 | .schema() |
| 264 | .fields() |
| 265 | .iter() |
| 266 | .map(|f| format!("{}: {:?}", f.name(), f.data_type())) |
| 267 | .collect(); |
| 268 | assert_eq!( |
| 269 | vec![ |
| 270 | "c1: Utf8", |
| 271 | "c2: Int64", |
| 272 | "c3: Int64", |
| 273 | "c4: Int64", |
| 274 | "c5: Int64", |
| 275 | "c6: Int64", |
| 276 | "c7: Int64", |
| 277 | "c8: Int64", |
| 278 | "c9: Int64", |
| 279 | "c10: Utf8", |
| 280 | "c11: Float64", |
| 281 | "c12: Float64", |
| 282 | "c13: Utf8", |
| 283 | "c14: Null", |
| 284 | "c15: Utf8" |
| 285 | ], |
| 286 | x |
| 287 | ); |
| 288 | |
| 289 | Ok(()) |
| 290 | } |
| 291 | |
| 292 | #[tokio::test] |
| 293 | async fn infer_schema_with_null_regex() -> Result<()> { |
nothing calls this directly
no test coverage detected
searching dependent graphs…