GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Query return limited to 87500 rows · Issue #1784 · googleapis/google-cloud-python

Query return limited to 87500 rows #1784

New issue
Copy link
New issue
Copy link
Closed
Closed
Query return limited to 87500 rows#1784
Copy link
Assignees
tseaver
Labels
api: bigqueryIssues related to the BigQuery API.backendpriority: p2Moderately-important priority. Fix may not be included in next release.

Description

@mikesjqubit
mikesjqubit
opened on May 10, 2016
Issue body actions

Hey guys, having a problem with the following code:

client = bigquery.Client.from_service_account_json(google_secrets_file)
query = client.run_sync_query(query_sql_string)
query.allow_large_results = True
query.use_query_cache = False
query.run()
response = query.fetch_data()

all large queries seem to return exactly 87500 rows (even if I export to an interim table first and select * on them). I can't see this number anywhere in the library or the documentation, so have no idea where this limit comes from or how to proceed!

Activity

  1. tseaver
    added
    api: bigqueryIssues related to the BigQuery API.
    on May 10, 2016
  2. tseaver commented on May 10, 2016

    @tseaver
    tseaver
    on May 10, 2016
    Contributor
    More actions

    @mikesjqubit Thanks for the report. gcloud.bigquery.query.Query.fetch_data actually returns data in "pages", with a page token. In the second example under the Querying data (synchronous) usage docs, note the loop over pages:

    query.run()
    do_something_with(query.schema, query.rows)
    token = query.page_token  # for initial request
    while True:
        do_something_with(query.schema, rows)
        if token is None:
            break
        rows, total_count, token = query.fetch_data(page_token=token)
  3. tseaver
    closed this as completedon May 10, 2016
  4. jgeewax commented on May 10, 2016

    @jgeewax
    jgeewax
    on May 10, 2016
    Contributor
    More actions

    IMO this is a problem that needs fixing (at further discussion). It's somewhat different from typical "listing" of things (ie list_topics()) but similar in that we're exposing implementation details when people don't care all that much about them.

    (related to #895)

    @mikesjqubit : What would you expect to be the right way to handle this? I don't think that making you write that while loop is the right answer.

  5. jgeewax
    reopened this on May 10, 2016
  6. mikesjqubit commented on May 11, 2016

    @mikesjqubit
    mikesjqubit
    on May 11, 2016
    Author
    More actions

    I was fully expecting to be able to download everything in one go, maybe there would be max_rows = None flag to set. I'm very surprised that the row limit is this small. Honestly, the ugliness doesn't concern me as much as the slowness of it - downloading 3m rows takes about 5 minutes using the loop method. Am considering exporting to GCS then downloading from there, it just feels so roundabout though!

    Reacted by Velizar VESSELINOV
  7. dhermes commented on May 11, 2016

    @dhermes
    dhermes
    on May 11, 2016
    Contributor
    More actions

    @fhoffa Any thoughts?

  8. tseaver
    added
    backend
    on Sep 21, 2016
  9. tseaver commented on Sep 21, 2016

    @tseaver
    tseaver
    on Sep 21, 2016
    Contributor
    More actions

    @fhoffa bump.

    Reacted by Velizar VESSELINOV
  10. lukesneeringer
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Apr 19, 2017
  11. tswast commented on Aug 9, 2017

    @tswast
    tswast
    on Aug 9, 2017
    Contributor
    More actions

    This was fixed when the fetch_data method was changed to return a core iterator. #2840

  12. tswast
    closed this as completedon Aug 9, 2017
  13. JustinBeckwith
    assigned
    tseaver
    on Feb 1, 2021
  14. parthea
    added a commit that references this issue on Sep 22, 2023

    chore: move samples from python-docs-sample (#33)

    69c4425
  15. parthea
    added a commit that references this issue on Mar 6, 2026

    docs: update multiple samples to change query to query_and_wait (#1784)

    17442cd
  16. parthea
    added a commit that references this issue on Apr 1, 2026

    docs: integrations notebook extracts token from `bqclient._http.crede…

    c28cf73
  17. parthea
    added a commit that references this issue on Sep 8, 2026

    docs: migrate code from googleapis/python-bigquery (#18303)

    23f9a74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

api: bigqueryIssues related to the BigQuery API.backendpriority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.