Skip to content

Commit 69dfe6c

Browse files
authored
Make error msg for oom human readable (#16050)
1 parent 07fe23f commit 69dfe6c

File tree

5 files changed

+46
-39
lines changed

5 files changed

+46
-39
lines changed

datafusion/core/tests/memory_limit/mod.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async fn group_by_none() {
8484
TestCase::new()
8585
.with_query("select median(request_bytes) from t")
8686
.with_expected_errors(vec![
87-
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as: AggregateStream"
87+
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as:\n AggregateStream"
8888
])
8989
.with_memory_limit(2_000)
9090
.run()
@@ -96,7 +96,7 @@ async fn group_by_row_hash() {
9696
TestCase::new()
9797
.with_query("select count(*) from t GROUP BY response_bytes")
9898
.with_expected_errors(vec![
99-
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as: GroupedHashAggregateStream"
99+
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as:\n GroupedHashAggregateStream"
100100
])
101101
.with_memory_limit(2_000)
102102
.run()
@@ -109,7 +109,7 @@ async fn group_by_hash() {
109109
// group by dict column
110110
.with_query("select count(*) from t GROUP BY service, host, pod, container")
111111
.with_expected_errors(vec![
112-
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as: GroupedHashAggregateStream"
112+
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as:\n GroupedHashAggregateStream"
113113
])
114114
.with_memory_limit(1_000)
115115
.run()
@@ -122,7 +122,7 @@ async fn join_by_key_multiple_partitions() {
122122
TestCase::new()
123123
.with_query("select t1.* from t t1 JOIN t t2 ON t1.service = t2.service")
124124
.with_expected_errors(vec![
125-
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as: HashJoinInput",
125+
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as:\n HashJoinInput",
126126
])
127127
.with_memory_limit(1_000)
128128
.with_config(config)
@@ -136,7 +136,7 @@ async fn join_by_key_single_partition() {
136136
TestCase::new()
137137
.with_query("select t1.* from t t1 JOIN t t2 ON t1.service = t2.service")
138138
.with_expected_errors(vec![
139-
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as: HashJoinInput",
139+
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as:\n HashJoinInput",
140140
])
141141
.with_memory_limit(1_000)
142142
.with_config(config)
@@ -149,7 +149,7 @@ async fn join_by_expression() {
149149
TestCase::new()
150150
.with_query("select t1.* from t t1 JOIN t t2 ON t1.service != t2.service")
151151
.with_expected_errors(vec![
152-
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as: NestedLoopJoinLoad[0]",
152+
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as:\n NestedLoopJoinLoad[0]",
153153
])
154154
.with_memory_limit(1_000)
155155
.run()
@@ -161,7 +161,7 @@ async fn cross_join() {
161161
TestCase::new()
162162
.with_query("select t1.*, t2.* from t t1 CROSS JOIN t t2")
163163
.with_expected_errors(vec![
164-
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as: CrossJoinExec",
164+
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as:\n CrossJoinExec",
165165
])
166166
.with_memory_limit(1_000)
167167
.run()
@@ -217,7 +217,7 @@ async fn symmetric_hash_join() {
217217
"select t1.* from t t1 JOIN t t2 ON t1.pod = t2.pod AND t1.time = t2.time",
218218
)
219219
.with_expected_errors(vec![
220-
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as: SymmetricHashJoinStream",
220+
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as:\n SymmetricHashJoinStream",
221221
])
222222
.with_memory_limit(1_000)
223223
.with_scenario(Scenario::AccessLogStreaming)
@@ -235,7 +235,7 @@ async fn sort_preserving_merge() {
235235
// so only a merge is needed
236236
.with_query("select * from t ORDER BY a ASC NULLS LAST, b ASC NULLS LAST LIMIT 10")
237237
.with_expected_errors(vec![
238-
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as: SortPreservingMergeExec",
238+
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as:\n SortPreservingMergeExec",
239239
])
240240
// provide insufficient memory to merge
241241
.with_memory_limit(partition_size / 2)
@@ -315,7 +315,7 @@ async fn sort_spill_reservation() {
315315
test.clone()
316316
.with_expected_errors(vec![
317317
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as:",
318-
"bytes for ExternalSorterMerge",
318+
"B for ExternalSorterMerge",
319319
])
320320
.with_config(config)
321321
.run()
@@ -344,7 +344,7 @@ async fn oom_recursive_cte() {
344344
SELECT * FROM nodes;",
345345
)
346346
.with_expected_errors(vec![
347-
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as: RecursiveQuery",
347+
"Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as:\n RecursiveQuery",
348348
])
349349
.with_memory_limit(2_000)
350350
.run()
@@ -396,7 +396,7 @@ async fn oom_with_tracked_consumer_pool() {
396396
.with_expected_errors(vec![
397397
"Failed to allocate additional",
398398
"for ParquetSink(ArrowColumnWriter)",
399-
"Additional allocation failed with top memory consumers (across reservations) as: ParquetSink(ArrowColumnWriter)"
399+
"Additional allocation failed with top memory consumers (across reservations) as:\n ParquetSink(ArrowColumnWriter)"
400400
])
401401
.with_memory_pool(Arc::new(
402402
TrackConsumersPool::new(

0 commit comments

Comments
 (0)