ahmed-mez opened a new issue, #16151: URL: https://github.com/apache/datafusion/issues/16151
### Is your feature request related to a problem or challenge? When dealing with complex SQL queries that involve multiple aggregate functions, it can be challenging to pinpoint which specific aggregation is causing a "Resources exhausted" error. The current error messages for `GroupedHashAggregateStream`, such as `Failed to allocate additional X bytes for GroupedHashAggregateStream[P] with Y bytes already allocated for this reservation`, are too generic. This makes it difficult to identify the problematic aggregation quickly, especially in queries with numerous aggregations, leading to increased debugging time. ### Describe the solution you'd like To improve the debuggability of memory-related errors, I propose enhancing the name of `GroupedHashAggregateStream` within the `MemoryConsumer`. The enhanced name should include the specific aggregate functions being processed by that stream instance. For example, an error message could change from: `Failed to allocate additional X bytes for GroupedHashAggregateStream[0] with Y bytes already allocated for this reservation` To something more informative like: `Failed to allocate additional X bytes for GroupedHashAggregateStream[3] (COUNT(col_a), SUM(col_b)) with Y bytes already allocated for this reservation`. This change would provide immediate insight into which aggregate operations are contributing to memory pressure, significantly speeding up the debugging process for large and complex queries. ### Describe alternatives you've considered _No response_ ### Additional context _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org