More accurate memory accounting in external sort
- Dominant language
- Rust
- Stars
- 9.3k
- Forks
- 2.4k
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 344
Description
### Is your feature request related to a problem or challenge?
https://github.com/apache/datafusion/pull/14644 fixed an external sorting bug. Each batch's memory overhead is estimated as `2 * batch memory size` for the extra row conversion overhead. It works for common cases but still can fail. See https://github.com/apache/datafusion/pull/14644#issuecomment-2659063578 and https://github.com/apache/datafusion/pull/14644#issuecomment-2660783992.
To implement a more accurate memory size estimation for those edge cases, we can first do `col->row` conversion and measure the memory consumption. (depends on https://github.com/apache/datafusion/issues/7053)
### Describe the solution you'd like
_No response_
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.