9
votes

Simple select queries with timestamp are failing :

SELECT COUNT(*) FROM [bi.table] WHERE  timestamp > DATE_ADD(CURRENT_TIMESTAMP(), -15, 'MINUTE') and column1 is null

Query Failed:

Error: An internal error occurred and the request could not be completed.
Job ID: streamrail:job_lndEirUwwM_khdBrV8eMDmBDFiE

Is there anything wrong with the bigquery system?

https://status.cloud.google.com/ does not say anything is wrong.

2
Can you show the query? - Leptonator
@Leptonator Edited question - Eran Chetzroni
Looks like it's working now :) - Eran Chetzroni
Can you post your final resolution? This way, it may be able to help other people in the future? - Leptonator
@EranChetzroni did you change anything or it just works for you now? - Bulat

2 Answers

5
votes

This error was actually unrelated to the timestamps. You hit an error in our streaming ingestion service. It was overloaded at the time you ran your query and it could not serve the data that had been ingested for your table. We are investigating and will fix the underlying issue. Sorry for the inconvenience.

-5
votes

Recommendation is to never use a wildcard with COUNT.. Especially large tables. If we re-write your query a bit, we get:

SELECT COUNT(user) count_user
FROM [bi.table]
WHERE  timestamp > DATE_ADD(CURRENT_TIMESTAMP(), -15, 'MINUTE')
and column1 is null

depending on the API, you can also use:

and isnull(column1)

you can also use:

and isnull(column1)

you can also use:

and isempty(column1)

you can also use:

and column1=''

This is using the KB article from Microsoft talking about the difference between isnull(column1) or colum1 is null..

Also, with SQL server.. You can use Locking Hints..

FROM [bi.table] (NOLOCK)

but, I am not familiar with the Google API... So, these are just suggestions.