Hi Huanian, thanks for reaching out.
I suppose that you are not trying to query to download an entire large catalog; if yes, please add qualifying 'WHERE' conditions to your SQL to ask for only the sources that match your criteria.
Then, standard synchronous queries have a runtime limit of 300 seconds. You can increase that limit per-query to max. 600 seconds, like this:
result = qc.query(sql='SELECT ...',timeout=600)
For even longer-running queries, you will need to use the async mode, for instance like this:
jobid = qc.query(sql='SELECT ...',async_=True)
`jobid` is a unique job ID. From time to time you can check the status of the job:
While the query is still running, this will print 'EXECUTING'. Once it says 'COMPLETED', you can then fetch the results of your query:
result = qc.results(jobid)
Final point: you can store the results of your queries directly to your Data Lab file storage (vospace) or as tables in your personal database (mydb). This will spare your having to download the files (i.e. you can continue to work with them on the Data Lab system). Run such queries e.g. like this:
Please let us know if this was useful, or if we can help otherwise.
Robert for the DL team