opensourcegeek opensourcegeek - 11 months ago 52
JSON Question

How to export data from bigquery based on some filter criteria

I'm wondering how to export data from bigquery table with a lot of data (partitioned), I'd like to download data just for a day but I'm not sure if there is any mechanism available already to do this. The documentation talks about exporting all data but not based on some filter criteria.

Is it possible to run a query with where clause and save the data into another table perhaps and run export?

Answer Source

Yes it's exactly as you say.

  1. Run the query, and set a destination table.
  2. Once the query finishes the data will be in your table.
  3. Issue the export job from the new table.
  4. You can delete your own table now.

About exporting data and about storing query results in a table some Java examples are mentioned here.