()
| 1456 | |
| 1457 | #[tokio::test] |
| 1458 | async fn test_basic_table_scan() -> Result<()> { |
| 1459 | let ctx = SessionContext::new(); |
| 1460 | |
| 1461 | // Test basic table creation and scanning |
| 1462 | let path = "table/file.json"; |
| 1463 | register_test_store(&ctx, &[(path, 10)]); |
| 1464 | |
| 1465 | let format = JsonFormat::default(); |
| 1466 | let opt = ListingOptions::new(Arc::new(format)).with_collect_stat(false); |
| 1467 | let schema = Schema::new(vec![Field::new("a", DataType::Boolean, false)]); |
| 1468 | let table_path = ListingTableUrl::parse("test:///table/")?; |
| 1469 | |
| 1470 | let config = ListingTableConfig::new(table_path) |
| 1471 | .with_listing_options(opt) |
| 1472 | .with_schema(Arc::new(schema)); |
| 1473 | |
| 1474 | let table = ListingTable::try_new(config)?; |
| 1475 | |
| 1476 | // The scan should work correctly |
| 1477 | let scan_result = table.scan(&ctx.state(), None, &[], None).await; |
| 1478 | assert!(scan_result.is_ok(), "Scan should succeed"); |
| 1479 | |
| 1480 | // Verify file listing works |
| 1481 | let result = table.list_files_for_scan(&ctx.state(), &[], None).await?; |
| 1482 | assert!( |
| 1483 | !result.file_groups.is_empty(), |
| 1484 | "Should list files successfully" |
| 1485 | ); |
| 1486 | |
| 1487 | Ok(()) |
| 1488 | } |
| 1489 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…