(query: usize)
| 553 | } |
| 554 | |
| 555 | async fn round_trip_physical_plan(query: usize) -> Result<()> { |
| 556 | let ctx = SessionContext::default(); |
| 557 | let path = get_imdb_data_path()?; |
| 558 | let common = CommonOpt { |
| 559 | iterations: 1, |
| 560 | partitions: Some(2), |
| 561 | batch_size: Some(8192), |
| 562 | mem_pool_type: "fair".to_string(), |
| 563 | memory_limit: None, |
| 564 | sort_spill_reservation_bytes: None, |
| 565 | debug: false, |
| 566 | simulate_latency: false, |
| 567 | }; |
| 568 | let opt = RunOpt { |
| 569 | query: Some(query), |
| 570 | common, |
| 571 | path: PathBuf::from(path.to_string()), |
| 572 | file_format: "parquet".to_string(), |
| 573 | mem_table: false, |
| 574 | output_path: None, |
| 575 | disable_statistics: false, |
| 576 | prefer_hash_join: true, |
| 577 | hash_join_buffering_capacity: 0, |
| 578 | }; |
| 579 | opt.register_tables(&ctx).await?; |
| 580 | let queries = get_query_sql(map_query_id_to_str(query))?; |
| 581 | for query in queries { |
| 582 | let plan = ctx.sql(&query).await?; |
| 583 | let plan = plan.create_physical_plan().await?; |
| 584 | let bytes = physical_plan_to_bytes(plan.clone())?; |
| 585 | let plan2 = physical_plan_from_bytes(&bytes, &ctx.task_ctx())?; |
| 586 | let plan_formatted = format!("{}", displayable(plan.as_ref()).indent(false)); |
| 587 | let plan2_formatted = |
| 588 | format!("{}", displayable(plan2.as_ref()).indent(false)); |
| 589 | assert_eq!(plan_formatted, plan2_formatted); |
| 590 | } |
| 591 | Ok(()) |
| 592 | } |
| 593 | |
| 594 | macro_rules! test_round_trip_logical { |
| 595 | ($tn:ident, $query:expr) => { |
nothing calls this directly
no test coverage detected
searching dependent graphs…