Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default values for columns in Big Query Tables

Is there a way to set default values for columns in tables in big query? I would like to set 'false' as a default value for a column of boolean data type.

like image 245
user2831859 Avatar asked Jun 03 '16 21:06

user2831859


1 Answers

A nullable column can (trivially) have a NULL default value, but there is no other notion of default in BigQuery (you either insert a particular value or omit the value and it will have the NULL value).

That said, if you want to wrap your raw table in a View, you can map a NULL column value to any default that you like.

like image 109
Adam Lydick Avatar answered Sep 23 '22 09:09

Adam Lydick