Currently long-running queries that run on Quarry such as https://quarry.wmcloud.org/query/74483 fail on superset with the message "DB engine Error 'query_id' This may be triggered by: Issue 1002 - The database returned an unexpected error. " (see attached screenshot)
I believe this can be fixed by enabling Async Queries via Celery as per https://superset.apache.org/docs/installation/async-queries-celery/ "On large analytic databases, it’s common to run queries that execute for minutes or hours. To enable support for long running queries that execute beyond the typical web request’s timeout (30-60 seconds), it is necessary to configure an asynchronous backend for Superset ..."
This also enables a "results backend that defines where the worker will persist the query results" which is a feature that has been asked for in T169452.