Luis
Luis

Reputation: 1475

What is the equivalent of binary(8) and varbinary(16) of MySQL in BigQuery?

I'm moving data from MySQL table that has columns of types :

binary(8) 
varbinary(16) 

And I can't find the equivalent types in BigQuery documentation https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types

What are the equivalent types? I need to know what to choose for the creation of the table in BigQuery

Upvotes: 0

Views: 2121

Answers (1)

Elliott Brossard
Elliott Brossard

Reputation: 33755

BigQuery simply provides a BYTES type, which is of variable length. To write a bytes literal, you prefix the string with b, e.g.

SELECT b'\x10\x33';

You can read more in the data types documentation. Note that the BigQuery UI shows BYTES values in base64 format.

Upvotes: 4

Related Questions