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

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

问题描述

有没有办法为大查询中的表中的列设置默认值?我想将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).

也就是说,如果您想将原始表包装在视图中,您可以将 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.

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

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