标签:直接 zhang default column cal libtool version sele 枚举
ClickHouse 是俄罗斯的 Yandex 于 2016 年开源的列式存储数据库(DBMS),主要用于在线分析处理查询(OLAP),能够使用 SQL 查询实时生成分析数据报告。
[root@hadoop102 ~]# yum install -y libtool
[root@hadoop102 ~]# yum install -y *unixODBC*
1 [root@hadoop102 software]# ls 2 clickhouse-client-1.1.54236-4.el6.x86_64.rpm 3 clickhouse-server-1.1.54236-4.el6.x86_64.rpm 4 clickhouse-compressor-1.1.54236-4.el6.x86_64.rpm 5 clickhouse-server-common-1.1.54236-4.el6.x86_64.rpm 6 clickhouse-debuginfo-1.1.54236-4.el6.x86_64.rpm
1 [root@hadoop102 software]# rpm -ivh *.rpm Preparing... ########################################### [100%] 2 1:clickhouse-server- commo########################################### [ 20%] 3 2:clickhouse-server ########################################### [ 40%] 4 3:clickhouse-client 5 大数据技术之 Clickhouse ########################################### [ 60%] 6 4:clickhouse-debuginfo ########################################### [ 80%] 7 5:clickhouse-compressor ########################################### [100%]
1 [root@hadoop102 software]# nohup clickhouse-server --config- file=/etc/clickhouse-server/config.xml >null 2>&1 &
注:
>null --重定向输出
2>&1 --重定向绑定;详见另一篇:https://www.cnblogs.com/zhipeng-wang/p/14123777.html
5.启动客户端
[root@hadoop102 software]# clickhouse-client
ClickHouse client version 1.1.54236.
Connecting to localhost:9000.
Connected to ClickHouse server version 1.1.54236.
:)
整形,浮点型,布尔,字符串,枚举,数组,元组,日期
TinyLog,Memory,Merge,MergeTree,ReplacingMergeTre,UmmingMergeTree,Distribuated
基本语法:CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] ( name1 [type1] [DEFAULT|MATERIALIZED|ALIAS expr1], name2 [type2] [DEFAULT|MATERIALIZED|ALIAS expr2], ... ) ENGINE = engine 直接创建: :) create table t1(id UInt16,name String) engine=TinyLog 复制表结构创建: :) create table t2 as t1 engine=Memory 复制指定表的指定列创建: :) create table t3 engine=TinyLog as select * from t1
直接插入: :) insert into t1 values(1,‘zhangsan‘),(2,‘lisi‘),(3,‘wangwu‘) 插入指定表中的指定数据: :) insert into t2 select * from t3
添加指定列
:)alter table mt_table add column age UInt8
修改指定列
:)alter table mt_table modify column age UInt16
删除指定列
:)alter table mt_table drop column age
:)desc mt_table
标签:直接 zhang default column cal libtool version sele 枚举
原文地址:https://www.cnblogs.com/zhipeng-wang/p/14123806.html