Can you use field alias with space in Google Big Query

Sudhir Hasbe picture Sudhir Hasbe · Mar 8, 2015 · Viewed 11.1k times · Source

We need to create descriptive aliases for fields. Ideally we would like to create views with alias with a space. Is this possible? How can we do this?

Example: SELECT word, word_count "Word Count" FROM [publicdata:samples.shakespeare] LIMIT 1000

Answer

Alex Martelli picture Alex Martelli · Mar 9, 2015

No, the rules for field names (and aliases) in BigQuery are quite simple, and I quote:

Fields must contain only letters, numbers, and underscores, start with a letter or underscore, and be at most 128 characters long.

As you see, spaces, quote characters, and other punctuation, are not allowed. Feel free to open a feature request at https://code.google.com/p/google-bigquery/ (explaining your use case, esp. why using underscores in lieu of spaces is not acceptable) -- or star an existing FR at https://code.google.com/p/google-bigquery/issues/list if it coincides with your requirements.