clickhouse 添加表字段

您所在的位置:网站首页 clickhouse增加字段并更新数据 clickhouse 添加表字段

clickhouse 添加表字段

#clickhouse 添加表字段| 来源: 网络整理| 查看: 265

一、创表指定引擎

CREATE TABLE tb_test1 ( id Int8, name String ) ENGINE = Merge Tree;

二、复制表结构建表

create table log3 as log2 ;

三、添加字段

alter table tb_test2 add column age UInt8 COMMENT ‘注释’;

alter table tb_test2 add column gender String after name ;

四、删除字段

alter table tb_test2 drop column age ;

五、修改字段类型

alter table tb_test2 modify column gender UInt8 default 0 ;

六、修改添加字段注释

alter table tb_test2 comment column name ‘用户名’ ;

七、修改多张表

rename table tb_test2 to t2 , t1 to tt1 ;

八、csv数据导入clickhouse表中

clickhouse-client --user default --password xjy@123 -q ‘insert into test.tb_test1 format CSV’ < test.csv



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3