Skip to main content

When to use this

Different data sources follow different naming conventions. A CRM might return ContactFirstName, an advertising platform might use campaign-id, and a database export might use TOTAL AMT. Before joining or analyzing data from multiple sources, renaming columns to a consistent convention (typically snake_case) makes everything easier to work with downstream.

Sample input

A hubspot_contacts table in the Raw layer with mixed naming conventions: We want to rename all columns to snake_case:

Implementation

BigQuery also uses column aliases. Use backticks for columns with spaces or special characters.
BigQuery is case-insensitive for column names by default, but using explicit aliases ensures consistent naming for BI tools and downstream consumers.

Expected output


Tips and gotchas

Renaming columns doesn’t change the underlying data — it only affects how the column is referenced in the output. Always save the renamed table to a new layer (e.g., Trusted) so the raw data remains untouched.
Some BI tools are case-sensitive when referencing column names. Sticking to snake_case with all lowercase avoids surprises when connecting Looker Studio, Power BI, or Metabase to your data.