Currently, a query fails when it tries to spill data to a disk and that write results in an error. This can happen for multiple reasons: a) no write permission, b) bad disk.
The fix should do two things:
- Check for write permissions on startup
- Don't fail queries that hit an error at runtime (e.g. disk full) if there is another functional scratch disk that can be used instead.