MCPcopy Create free account
hub / github.com/apache/datafusion / round_trip_physical_plan

Function round_trip_physical_plan

benchmarks/src/imdb/run.rs:555–592  ·  view source on GitHub ↗
(query: usize)

Source from the content-addressed store, hash-verified

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) => {

Callers

nothing calls this directly

Calls 11

get_imdb_data_pathFunction · 0.85
map_query_id_to_strFunction · 0.85
physical_plan_to_bytesFunction · 0.85
physical_plan_from_bytesFunction · 0.85
sqlMethod · 0.80
get_query_sqlFunction · 0.70
to_stringMethod · 0.45
register_tablesMethod · 0.45
create_physical_planMethod · 0.45
cloneMethod · 0.45
task_ctxMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…