database - Redshift 光谱 - 更新外部光谱表列类型

标签 database amazon-web-services amazon-redshift amazon-redshift-spectrum

我创建了一个包含 4 列的外部表。 其中一列是自定义数据类型。

create EXTERNAL table public.test_table_1(
uuid varchar(36),
event_id varchar(36),
last_updated_timestamp bigint,
user_app struct<starttime : int, endtime : int, id_1 : struct<value : float>>

我想将user_app列更新为formar的新数据类型:

struct<starttime : int, endtime : int, id_1 : struct<value : float>, id_2 : struct<value : float>>

最佳答案

删除表并使用正确的列类型重新创建它怎么样?

由于它是外部表,因此删除它后您不会丢失任何日期。

DROP TABLE public.test_table_1;

create EXTERNAL table public.test_table_1(
    uuid varchar(36),
    event_id varchar(36),
    last_updated_timestamp bigint,
    user_app struct<
        starttime : int, 
        endtime : int, 
        id_1 : struct<value : float>, 
        id_2 : struct<value : float>
     >
);

关于database - Redshift 光谱 - 更新外部光谱表列类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62899873/

相关文章:

postgresql - string_to_array 函数

database - 在编程中过滤表还是在数据库中过滤表更快?

amazon-web-services - 为什么 base64 是 sha1/sha256 哈希?

ruby-on-rails - 错误:推送到 Heroku 时未初始化常量 Sprockets::Helpers

java - spring cloud aws 项目不再有活跃的所有者了吗?

sql - 基于 VARCHAR 大小的 Amazon Redshift 查询性能不佳

sql - Redshift COPY 命令返回 STL_load_error 1205 无效的日期格式 - 长度必须为 10 或更多

mysql - 如何使用 mysqlworkbench 连接到 otrs MySQL 数据库

SQL 插入列名作为数据

ruby-on-rails - 为什么有created_at和updated_at?