2

I am running my BigQuery code in RStudio using bigrquery package and one of the lines of the query contains a large list of integers (approx. 500 numbers). The query runs perfectly on BigQuery but when I try to run the same in RStudio using the above said package, it throws me the following error:

Syntax error: Expected ")" or "," but got keyword GROUP at [180:1] [invalidQuery]

I believe the problem is due to the large list that I have written in the query because when I print my results without that list and filter out later using R, it works perfectly but the only problem then is that I have to download large quantity of results (approx. 1.6M rows) which takes a lot of time.

Does anyone know a work around such problem? Thanks!

  • Probably (what else could it be?) you've got a missing closing bracket `)` before the GROUP keyword, as the error message informs you. What happens if you add this to the query? – Edward Feb 15 '20 at 12:15
  • 'The query runs perfectly on BigQuery'. Already stated. – IchBinShreyans Feb 15 '20 at 13:14
  • R != BigQuery. While BigQuery may ignore syntax errors, R certainly won't. – Edward Feb 15 '20 at 13:15
  • Sorry but I'm unable to make sense out of what you're saying. First, why would BigQuery ignore errors? It doesn't. It definitely gives a warning message when there is a wrong syntax. Second, the problem here is that the query that runs perfectly in BigQuery is throwing a syntax error when run in RStudio using `bigrquery` – IchBinShreyans Feb 16 '20 at 16:40
  • I dont know. Ive never used BigQuery. But maybe you've just answered your own question. Google's BigQuery gives a warning if the query has syntax errors, but still runs, as long as the errors are not too stupid. R will definitely not run if the query has syntax errors. Your query has a syntax error. Solution: correct it. – Edward Feb 16 '20 at 17:03

0 Answers0