(query: usize)
| 515 | } |
| 516 | |
| 517 | async fn round_trip_logical_plan(query: usize) -> Result<()> { |
| 518 | let ctx = SessionContext::default(); |
| 519 | let path = get_imdb_data_path()?; |
| 520 | let common = CommonOpt { |
| 521 | iterations: 1, |
| 522 | partitions: Some(2), |
| 523 | batch_size: Some(8192), |
| 524 | mem_pool_type: "fair".to_string(), |
| 525 | memory_limit: None, |
| 526 | sort_spill_reservation_bytes: None, |
| 527 | debug: false, |
| 528 | simulate_latency: false, |
| 529 | }; |
| 530 | let opt = RunOpt { |
| 531 | query: Some(query), |
| 532 | common, |
| 533 | path: PathBuf::from(path.to_string()), |
| 534 | file_format: "parquet".to_string(), |
| 535 | mem_table: false, |
| 536 | output_path: None, |
| 537 | disable_statistics: false, |
| 538 | prefer_hash_join: true, |
| 539 | hash_join_buffering_capacity: 0, |
| 540 | }; |
| 541 | opt.register_tables(&ctx).await?; |
| 542 | let queries = get_query_sql(map_query_id_to_str(query))?; |
| 543 | for query in queries { |
| 544 | let plan = ctx.sql(&query).await?; |
| 545 | let plan = plan.into_optimized_plan()?; |
| 546 | let bytes = logical_plan_to_bytes(&plan)?; |
| 547 | let plan2 = logical_plan_from_bytes(&bytes, &ctx.task_ctx())?; |
| 548 | let plan_formatted = format!("{}", plan.display_indent()); |
| 549 | let plan2_formatted = format!("{}", plan2.display_indent()); |
| 550 | assert_eq!(plan_formatted, plan2_formatted); |
| 551 | } |
| 552 | Ok(()) |
| 553 | } |
| 554 | |
| 555 | async fn round_trip_physical_plan(query: usize) -> Result<()> { |
| 556 | let ctx = SessionContext::default(); |
nothing calls this directly
no test coverage detected
searching dependent graphs…