While working on
IMPALA-9856, I found that the following DCHECK in SpillableRowBatchQueue::AddBatch consistently hit when result spooling is enabled and row size is larger than resource_profile_.max_reservation, causing impalad to crash.
We can reproduce this issue by adding the following query options in
Additionally, setting max_result_spooling_mem to 512MB will increase
resource_profile_.max_reservation to fit the large row and avoid this DCHECK.
Instead of DCHECK, I think impalad should return error status, suggesting that user need to set larger max_result_spooling_mem.
Another solution is to also consider max_row_size when computing maxMemReservationBytes in PlanRootSink.java.