一、MaxCompute
MaxCompute:大數據計算服務(MaxCompute,原名ODPS)是一種快速、完全託管的EB級數據倉庫解決方案。
二、常見語法
1.創建表
create table a(字段1 類型 comment 描述,字段2 類型 comment 描述......)
2.創建帶分區的表
create table a(字段1 類型 comment 描述,字段2 類型 comment 描述......) partitioned by (分區字段1 類型 comment 描述,分區字段2 類型 comment 描述)
3.指定生命週期
create table a (字段1 類型 comment 描述,......)partitioned by (分區字段1 類型 comment 描述) lifecycle 天;
4.複製表結構
create table a like b
5.複製表(結構+數據)
create table a as select * from b
6.查看所有表
show tables
7.查看部分表
show tables like 'dim'
8.顯示錶分區
show partitions a;
9.添加列
alter table a add columns (列名 類型 comment 描述,列名 類型 comment 描述......);
10.更改表名
alter table a rename to b;
11.刪除表
drop table if EXISTS b;
12.更改列名
alter table a change column old_col_name rename to new_col_name;
13.刪除分區
alter table a drop if exists partition(分區1=分區值,分區2=分區值);
14.