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 — Is there any way to get the number of rows actually loaded, but not the total count for a table. · Issue #1128 · googleapis/python-bigquery

This repository was archived by the owner on Mar 6, 2026. It is now read-only.
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Is there any way to get the number of rows actually loaded, but not the total count for a table. #1128

Copy link
Copy link
Closed
Closed
Is there any way to get the number of rows actually loaded, but not the total count for a table.#1128
Copy link
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.priority: p3Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.wontfixThis will not be worked on

Description

@zhongdai
zhongdai
opened on Feb 3, 2022
Issue body actions

Here is an example, the code snippet is

    # make a call of loadjob and use .result() to wait until it competes

    table = client.get_table(table_id)  # Make an API request.
    print(
        "Loaded {} rows and {} columns to {}".format(
            table.num_rows, len(table.schema), table_id
        )
    )

After the load job completed, it calls get_table to get the num_rows, and prints it. It works if we do a fresh load to an empty table, but when we load a file (or files) to an existing table by using APPEND mode, that number of rows is not the actually loaded count.

My workaround is, get_table() twice and calculate the difference between two counts. I am wondering is there any better approach to get the actually loaded rows (it is like the affected rows in other DBMS).

Reacted by Mehul Patel

Activity

  1. product-auto-label
    added
    api: bigqueryIssues related to the googleapis/python-bigquery API.
    on Feb 3, 2022
  2. meredithslota
    added
    type: questionRequest for information or clarification. Not an issue.
    on Feb 3, 2022
  3. tswast
    added
    priority: p3Desirable enhancement or fix. May not be included in next release.
    on Feb 8, 2022
  4. mehul1811 commented on Aug 14, 2022

    @mehul1811
    mehul1811
    on Aug 14, 2022
    More actions

    I am facing the same issue when appending the results of a query to an existing table using the QUERY job. Below code also gives the total count of rows in the destination table after appending:

    query_job_config = bigquery.QueryJobConfig(destination_table)
    query_job = bq_client.query(sql, job_config=query_job_config)
    results = query_job.result()
    print(results.total_rows)
    
    Reacted by Javier Porras-Valenzuela
  5. meredithslota
    added
    priority: p3Desirable enhancement or fix. May not be included in next release.
    and removed
    priority: p3Desirable enhancement or fix. May not be included in next release.
    on Apr 14, 2023
  6. chalmerlowe
    added
    wontfixThis will not be worked on
    on Jun 7, 2023
  7. chalmerlowe commented on Jun 7, 2023

    @chalmerlowe
    chalmerlowe
    on Jun 7, 2023
    Collaborator
    More actions

    Based on staffing and project priorities, this item will not be worked.

  8. chalmerlowe
    closed this as completedon Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigqueryIssues related to the googleapis/python-bigquery API.priority: p3Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.wontfixThis will not be worked on

    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.