I am trying to create something similar to the Google BigQuery toolbar, except for the predefined queries / views. The problem I am facing is pagination of data.
tabledata endpoint supports pagination in which you can specify the starting index or use the page token, which allows me to do something like this:
query_reply = table_data_job.list(projectId=settings.PROJECT_ID, datasetId=settings.DATASET_ID, tableId=table, startIndex=offset, maxResults=page_size).execute()
The problem is that I would like to run certain queries (or at least order the results of a table).
query_data = {'query': 'SELECT * FROM my_dataset.foo_table LIMIT %s' % page_size} query_reply = job_collection.query(projectId=settings.PROJECT_ID, body=query_data).execute()
As far as I know, there is no way to do the offset with the above code. Is it just something that BigQuery is not suitable? I assume that an alternative would be to do pagination in memory and work with smaller result sets?
source share