Commit 8fe926d
authored
## Which issue does this PR close?
- Closes #20564.
## Rationale for this change
Currently, `datafusion-cli` submodule does not have test coverage for
`--mem-pool-type = fair / unbounded` (default: `greedy` and `unbounded`
memory pool is used when both `--memory-limit` and `--mem-pool-type` are
`not` set). Legacy test cases use `greedy` memory pool by setting
`--memory-limit`. This PR aims to cover `--mem-pool-type = fair /
unbounded` cases with `--memory-limit` and `--top-memory-consumers`
usages. Also, `datafusion-cli` is a client used by end-users so
extending test coverages of the exposed features can be useful for the
functional verification and long-term maintenance.
**Case1:** `fair` memory pool usage by `datafusion-cli` when
`top-memory-consumers = 0` (Top Memory Consumers will not be listed when
memory is exhausted)
```
program: datafusion-cli
args:
- "--memory-limit"
- 10M
- "--mem-pool-type"
- fair
- "--command"
- "select * from generate_series(1,500000) as t1(v1) order by v1;"
- "--top-memory-consumers"
- "0"
```
**Case2:** `fair` memory pool usage by `datafusion-cli` when
`top-memory-consumers > 0` (Top Memory Consumers will be listed when
memory is exhausted)
```
program: datafusion-cli
args:
- "--memory-limit"
- 10M
- "--mem-pool-type"
- fair
- "--command"
- "select * from generate_series(1,500000) as t1(v1) order by v1;"
- "--top-memory-consumers"
- "2"
```
**Case3:** `unbounded` memory pool usage by `datafusion-cli`
```
program: datafusion-cli
args:
- "--maxrows"
- "10"
- "--command"
- "select * from generate_series(1,500000) as t1(v1) order by v1;"
```
## What changes are included in this PR?
Explained under above section.
## Are these changes tested?
Yes, being added new integration tests and they are successful locally:
```
test test_cli_top_memory_consumers_with_mem_pool_type::case_1 ... ok
test test_cli_top_memory_consumers_with_mem_pool_type::case_2 ... ok
test test_cli_with_unbounded_memory_pool::case_1 ... ok
```
## Are there any user-facing changes?
No
1 parent bfa0ea8 commit 8fe926d
4 files changed
Lines changed: 132 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
218 | 255 | | |
219 | 256 | | |
220 | 257 | | |
| |||
232 | 269 | | |
233 | 270 | | |
234 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
235 | 281 | | |
236 | 282 | | |
237 | 283 | | |
238 | 284 | | |
239 | | - | |
240 | | - | |
| 285 | + | |
241 | 286 | | |
242 | 287 | | |
243 | 288 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments