user11572311
user11572311

Reputation: 13

bigquery - save large query results

I have a question about saving large query results to either an external csv or to google sheets. I have a simple query that generates about 23,000 results:

#standardSQL
SELECT DISTINCT id1, id2
FROM `tableA`
WHERE A LIKE "%abcdefg%"
AND B LIKE "%some text%"
AND ts >= TIMESTAMP("2019-04-25 00:00:00")
AND ts < TIMESTAMP("2019-05-29 23:59:00")

I can't save more than 16,000 of these results to a csv file or output to google sheets. I want to be able to save all 23,000 results either into 1 file or into several files, but I don't know how to go about doing this. My permissions don't allow me to save the query output to a new table.

Upvotes: 1

Views: 2024

Answers (1)

Elliott Brossard
Elliott Brossard

Reputation: 33725

  1. Run the query as usual, then click the "Job information" tab.
  2. There will be a "Destination table" entry with a link that says, "Temporary table." Click the link.
  3. From this page, click "Export," then "Export to GCS."
  4. Now you can export the contents of the table as CSV.

Upvotes: 2

Related Questions