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

Function test_multiple_configs

datafusion/core/tests/sql/runtime_config.rs:94–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92
93#[tokio::test]
94async fn test_multiple_configs() {
95 let ctx = SessionContext::new();
96
97 ctx.sql("SET datafusion.runtime.memory_limit = '100M'")
98 .await
99 .unwrap()
100 .collect()
101 .await
102 .unwrap();
103 ctx.sql("SET datafusion.execution.batch_size = '2048'")
104 .await
105 .unwrap()
106 .collect()
107 .await
108 .unwrap();
109
110 let query = "select * from generate_series(1,100000) as t1(v1) order by v1;";
111 let result = ctx.sql(query).await.unwrap().collect().await;
112
113 assert!(result.is_ok(), "Should not fail due to memory limit");
114
115 let state = ctx.state();
116 let batch_size = state.config().options().execution.batch_size;
117 assert_eq!(batch_size, 2048);
118}
119
120#[tokio::test]
121async fn test_memory_limit_enforcement() {

Callers

nothing calls this directly

Calls 6

newFunction · 0.85
collectMethod · 0.80
sqlMethod · 0.80
stateMethod · 0.45
optionsMethod · 0.45
configMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…