Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BigQuery: Cast INT64 to BYTES (or binary representation)

How can I see the binary representation of an INT64 in BigQuery? Casting it to the BYTES type would also work.

like image 959
Ted Avatar asked Oct 30 '25 01:10

Ted


1 Answers

As stated by @Elliot Brossard, it is a matter of implementation how the INT64 type is represented.

Moreover, having a look at the documentation, you will be able to see the available conversion types in BigQuery. INT64 can only cast to BOOL, FLOAT64, INT64 and STRING.

If you really need the Bytes or Binary representation of an integer value in BigQuery, you will have to either pre-process it programatically and add a new column containing those values, or post-process it programatically when you retrieve your data.

like image 179
dsesto Avatar answered Nov 01 '25 09:11

dsesto