本文介绍了在现有表中为雪花中的默认时间戳添加新列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在现有表中添加包含 default 时间 的新列,但它不允许任何当前时间戳或 '2019-11-14 00:00:00.000' 这个时间格式为雪花.
i am trying to add new column which contain default time in existing table but it wont allow any current timestamp or '2019-11-14 00:00:00.000' this time format in snowflake.
推荐答案
表创建后唯一可以添加的列默认类型是 默认序列.
所有其他列默认是 不支持.
The only type of column default that can be added after table creation is a default sequence.
All other column defaults are not supported.
一种解决方法可能是:
- 创建新的表格格式
- 将旧表的数据插入到新表中
- 同步后,暂停写入旧表
- 运行 swap with 命令以以旧换新
- create the new table format
- insert the old table's data into the new table
- when synced, pause writing to the old table
- run the swap with command to replace the new with the old
这篇关于在现有表中为雪花中的默认时间戳添加新列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!