user3447653
user3447653

Reputation: 4148

Executing the query using bq command line in Google Big Query

I execute a query using the below Python script and the table gets populated with 2,564,691 rows. When I run the same query using Google Big Query console, it returns 17,379,353 rows (query is as-is). I was wondering whether there is some issue with the below script. Not sure whether --replace in bq query replaces the past result set instead of appending to it.

Any help would be appreciated.

dateToday =  (time.strftime("%Y/%m/%d"))
dateToday1 = dateToday.replace('/','')

commandStr = "type C:\Users\query.txt | bq query --allow_large_results --replace --destination_table table:dataset1_%s -n 1" %(dateToday1)

Upvotes: 0

Views: 917

Answers (1)

Mikhail Berlyant
Mikhail Berlyant

Reputation: 172944

In the Web UI you can use Query History option to navigate to respective queries.
After you locate them - you can expand respective entries and see what exactly query was executed
I am more than sure that just comparing query texts you will see source of "discrepancy" right away!

added

In Query History - not only you can see Query Text, but also all configuration properties that were used for respective query - like Write Preference for example and others. So even if query text the same you can see potential difference in configuration that will give you a clue

Upvotes: 1

Related Questions