schemagoogle-bigquerydatabase-schema

In Google Bigquery do NULL fields take up space?


I'm working on designing an event schema to be put into Google Bigquery. The current design is such that many of the fields will often be NULL, e.g. an event from a mobile application won't have URL or browser information, while an event from a website won't have hardware specs. Additionally, a lot of the information in the current schema is fairly static, and wouldn't need to be included with every event.

If fields in events are left as NULL, will they still take up space within the table? I'm wondering if it's just better to break up the events somehow. Are there best practices on storing what would otherwise be duplicate information?


Solution

  • From BigQuery's pricing page:

    Null values for any data type are calculated as 0 bytes.

    So no, they do not take up space from a byte-count or pricing perspective.

    Edit 2024

    BigQuery Pricing page doesn't include this information now. You can find same information here