(query: usize)
| 503 | } |
| 504 | |
| 505 | async fn round_trip_physical_plan(query: usize) -> Result<()> { |
| 506 | let ctx = SessionContext::default(); |
| 507 | let path = get_tpch_data_path()?; |
| 508 | let common = CommonOpt { |
| 509 | iterations: 1, |
| 510 | partitions: Some(2), |
| 511 | batch_size: Some(8192), |
| 512 | mem_pool_type: "fair".to_string(), |
| 513 | memory_limit: None, |
| 514 | sort_spill_reservation_bytes: None, |
| 515 | debug: false, |
| 516 | simulate_latency: false, |
| 517 | }; |
| 518 | let opt = RunOpt { |
| 519 | query: Some(query), |
| 520 | common, |
| 521 | path: PathBuf::from(path.to_string()), |
| 522 | scale_factor: Some(1.0), |
| 523 | file_format: "tbl".to_string(), |
| 524 | mem_table: false, |
| 525 | output_path: None, |
| 526 | disable_statistics: false, |
| 527 | prefer_hash_join: true, |
| 528 | enable_piecewise_merge_join: false, |
| 529 | sorted: false, |
| 530 | hash_join_buffering_capacity: 0, |
| 531 | }; |
| 532 | opt.register_tables(&ctx).await?; |
| 533 | let queries = crate::tpch::get_query_sql(query)?; |
| 534 | for query in queries { |
| 535 | let plan = ctx.sql(&query).await?; |
| 536 | let plan = plan.create_physical_plan().await?; |
| 537 | let bytes = physical_plan_to_bytes(plan.clone())?; |
| 538 | let plan2 = physical_plan_from_bytes(&bytes, &ctx.task_ctx())?; |
| 539 | let plan_formatted = format!("{}", displayable(plan.as_ref()).indent(false)); |
| 540 | let plan2_formatted = |
| 541 | format!("{}", displayable(plan2.as_ref()).indent(false)); |
| 542 | assert_eq!(plan_formatted, plan2_formatted); |
| 543 | } |
| 544 | Ok(()) |
| 545 | } |
| 546 | |
| 547 | macro_rules! test_round_trip_logical { |
| 548 | ($tn:ident, $query:expr) => { |
nothing calls this directly
no test coverage detected
searching dependent graphs…