11 August 2018 · David-Spring ·       Add to Favorites   Report

Google BigQuery error: No matching signature for operator >=

Error Message: No matching signature for operator >= for argument types: STRING, INT64. Supported signatures: ANY >= ANY at [1:60] 

while running the below R script to fetch some data from BiqQuery

This is where I get the error:

a <- dbGetQuery(db,
paste0("select * from dta.tbl where col1='",
somevariable"' and date>=",substr(gsub("\\D","",as.character(start.date)),3,8),
" and date<=",substr(gsub("\\D","",as.character(end.date)),3,8)))

Solution:

The data values are missing the single quote enclosure. eg date >='2019-01-01', it should work after adding the single quotes

a <- dbGetQuery(db,
paste0("select * from dta.tbl where col1='",
somevariable,"' and date>='",substr(gsub("\\D","",as.character(start.date)),3,8),
"' and date<='",substr(gsub("\\D","",as.character(end.date)),3,8), "'"))

David-Spring

posted on 11 August 2018

Read great educational content like this and a lot more !

Members get free exclusive access to content, new courses, and discounts. Signup for a free account to write a post / comment / upvote posts. Creating an account takes less than 5 seconds and you can start earning badges & points too

Copied