Giuseppe Pes
Giuseppe Pes

Reputation: 7912

Fetch time series from Google BigQuery

I am trying to fetch a list of prices from google big query using the following query :

    query_request = service.jobs()
    query_data = {
            'query': (
                '''
                SELECT
                    open 
                FROM
                   timeseries.price_2015
                ''')
        }

    query_response = query_request.query(
            projectId=project_id,
            body=query_data).execute()

The table contains 370000 records, but the query loads only the first 100000. I guess I am hitting some limit? Can you tell how I can fetch all records for the 'price' column?

Upvotes: 2

Views: 328

Answers (1)

Mikhail Berlyant
Mikhail Berlyant

Reputation: 173028

The number of rows returned is limited by the lesser of either the maximum page size or the maxResults property. See more in Paging Through list Results

Consider using Jobs: getQueryResults or Tabledata: list where you can call those API in loop passing PageToken from previous response to next call and collecting whole set on client side

Upvotes: 1

Related Questions