Reputation: 5126
Google BigQuery doesn't support UUID as data type. So, which option is better to store it:
STRING
: String with the format 8-4-4-4-12BYTES
: Array of 16 bytes (128 bits)Upvotes: 10
Views: 19288
Reputation: 33755
Edit: BigQuery now supports a function called GENERATE_UUID
. This returns a STRING
with 32 hexadecimal digits in five groups separated by hyphens in the form 8-4-4-4-12.
Original content:
Some discussion of the tradeoffs:
STRING
BYTES
later, you can potentially convert using a UDF.BYTES
depending on the operator, since string comparisons have to take UTF-8 encoding into account. (It sounds like this isn't an issue for you).BYTES
STRING
s later, you can potentially convert them using a UDF.Upvotes: 15