在现有表中为雪花中的默认时间戳添加新列 [英] adding new column in existing table for default timestamp in snowflake

查看:41
本文介绍了在现有表中为雪花中的默认时间戳添加新列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在现有表中添加包含 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.

一种解决方法可能是:

  1. 创建新的表格格式
  2. 将旧表的数据插入到新表中
  3. 同步后,暂停写入旧表
  4. 运行 swap with 命令以以旧换新
  1. create the new table format
  2. insert the old table's data into the new table
  3. when synced, pause writing to the old table
  4. run the swap with command to replace the new with the old

这篇关于在现有表中为雪花中的默认时间戳添加新列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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