Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BigQuery datatypes

I am starting with a new project and just wanted to verify before defining the table schema

Does BigQuery support anything other than:

string – 
integer –
float– 
boolean – 
like image 419
rshetye Avatar asked Jul 30 '12 13:07

rshetye


People also ask

What is record data type in BigQuery?

ARRAY and STRUCT or RECORD are complex data types to represent nested and repeated fields. BigQuery Nested and Repeated Fields. Nested Fields. A STRUCT or RECORD contains ordered fields each with a type and field name.


2 Answers

BigQuery data types official docs:

  • https://cloud.google.com/bigquery/data-types
  • https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types

The previous answer lists the basic datatypes:

  • STRING
  • INTEGER (INT64)
  • FLOAT (FLOAT64)
  • BOOLEAN

BigQuery also supports:

  • RECORD (JSON objects, see nested records)
  • TIMESTAMP
  • BYTES
  • DATE
  • TIME
  • DATETIME
  • ARRAY
  • STRUCT

2018 and now also:

  • NUMERIC
  • GEOGRAPHY

More on:

  • Nested records: https://developers.google.com/bigquery/docs/data#nested
  • Using timestamp: https://developers.google.com/bigquery/docs/timestamp
  • Docs: https://developers.google.com/bigquery/preparing-data-for-bigquery#datatypes
like image 154
Felipe Hoffa Avatar answered Sep 20 '22 15:09

Felipe Hoffa


Yes indeed.

BigQuery Type   ICD Type    Length    Checks

INTEGER         Integer     
FLOAT           Decimal     
STRING          Text        <65536  
BOOLEAN         Choice                "true" or "false", case-insensitive

https://developers.google.com/bigquery/articles/ingestionbestpractices#cutplace

like image 38
Charles Avatar answered Sep 18 '22 15:09

Charles