HiveSplitGenerator calculates the number of available slots from available memory like this:
I had a scenario where the total memory was calculated correctly, but the task memory returned -1. This led to error like these:
Admittedly, this happened during development, and hopefully will not occur on a properly configured cluster. (Although I'm not sure what the issue was on my setup, possibly XMX set higher than physical memory.)
In any case, it feels like setting availableSlots < 1 will never lead to desired behavior, so in such cases we could emit a warning and correct the value to 1.