| 92 | |
| 93 | #[tokio::test] |
| 94 | async 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] |
| 121 | async fn test_memory_limit_enforcement() { |