Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BigQuery - No matching signature for operator = for argument types: INT64, STRING

Im getting a weird error(Maybe im getting this error for the first time) from BQ.

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

Query:

SELECT col1
    ,col2
    ,col3
FROM tbl1
JOIN t2 ON t1.id = t2.id
JOIN t3 on t2.id = t3.id
JOIN t4 on t4.id = t1.id

Error line JOIN t2.id = t3.id t2.id is showing this error.

its an integer column.

like image 950
TheDataGuy Avatar asked May 02 '19 10:05

TheDataGuy


1 Answers

One of your comparisons is mixing types. This is a bad idea -- as the error message shows. You need to find out which pair (or pairs) and do one of the following:

cast(t2.id as string) = t3.id
t2.id = safe.cast(t3.id as int64)
like image 142
Gordon Linoff Avatar answered Oct 22 '22 11:10

Gordon Linoff