大查询表中列的默认值 [英] Default values for columns in Big Query Tables

查看:40
本文介绍了大查询表中列的默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在大型查询中为表中的列设置默认值?我想将boolean数据类型的列的默认值设置为false.

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.

推荐答案

可为空的列可以(通常)具有NULL默认值,但是BigQuery中没有其他默认概念(您可以插入特定值或省略值,它将具有NULL值.)

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).

也就是说,如果要将原始表包装在View中,则可以将NULL列值映射到所需的任何默认值.

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.

这篇关于大查询表中列的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆