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

Function cleanup_executes_cleanup_queries

benchmarks/src/sql_benchmark.rs:2867–2894  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2865
2866 #[tokio::test]
2867 async fn cleanup_executes_cleanup_queries() {
2868 let mut benchmark = parse_benchmark(
2869 r#"
2870run
2871SELECT 1;
2872
2873cleanup
2874CREATE TABLE cleanup_marker_a AS SELECT 7 AS value;
2875
2876cleanup
2877CREATE TABLE cleanup_marker_b AS SELECT value + 1 AS value FROM cleanup_marker_a;
2878"#,
2879 )
2880 .await
2881 .expect("benchmark should parse");
2882 let ctx = SessionContext::new();
2883
2884 benchmark.cleanup(&ctx).await.expect("cleanup should run");
2885
2886 let rows = ctx
2887 .sql("SELECT value FROM cleanup_marker_b")
2888 .await
2889 .expect("query should plan")
2890 .collect()
2891 .await
2892 .expect("query should run");
2893 assert_eq!(format_record_batches(&rows).unwrap(), vec![vec!["8"]]);
2894 }
2895
2896 #[tokio::test]
2897 async fn cleanup_propagates_query_failures() {

Callers

nothing calls this directly

Calls 5

parse_benchmarkFunction · 0.85
newFunction · 0.85
cleanupMethod · 0.80
collectMethod · 0.80
sqlMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…