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

Function round_trip_logical_plan

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

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 10

get_imdb_data_pathFunction · 0.85
map_query_id_to_strFunction · 0.85
logical_plan_to_bytesFunction · 0.85
logical_plan_from_bytesFunction · 0.85
sqlMethod · 0.80
into_optimized_planMethod · 0.80
get_query_sqlFunction · 0.70
to_stringMethod · 0.45
register_tablesMethod · 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…