Reputation: 379
I have a use case in which I do the following:
In the above use case, I faced an issue today where the queries I run had some discrepancy in the aggregated data. When I executed the same queries some time later from the Web UI of BigQuery, the aggregation were fine. My suspicion is that some of the inserted rows were not available for the query.
I read this documentation for BigQuery data availability. I have the following doubts in this:
Can somebody please clarify these?
Upvotes: 1
Views: 206
Reputation: 59175
For the questions:
Does the following operations come under this restriction?
Copy the result of a query to another table Exporting the result of a query to a csv file in cloud storage
The results of a query are immediately available for any operation (like copy and export) - even if that query had been ran on streamed data still in the buffer.
Upvotes: 1
Reputation: 207838
You can use _PARTITIONTIME is null
to detect which rows are in buffer. You can actually use this logic to further UNION this buffer to a date you wish (like today). You could do wire in some logic that reads the buffer and where time is null it will set a time for the rest of the query logic.
This buffer is by design a bit delayed, but if you need immediate access to data you need to use the IS NULL trick to be able to query it.
Upvotes: 2