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).
Here is an example, the code snippet is
After the load job completed, it calls
get_tableto get thenum_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 usingAPPENDmode, 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 theaffected rowsin other DBMS).