Skip to content
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

Description

@zhongdai

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).

Activity

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