odps sql:与hive sql语法基本一致
odpscmd.bat
SQL语句不分大小写,使用“–”进行注释,使用分号作为语句结束符号
数据定义语言(DDL),数据操作语言(DML),数据控制语言(DCL)和事务控制语言(TCL);在ODPS中使用的主要是DDL跟DML
查看表空间:1:show tables; 2:ls tables;3:list tables;
查看表:desc biaoming;
切库:use 库名;
退出:1:quit;2:q;
上传文本txt到对应分区表:tunnel upload -h true -fd '\t' C:\Users\Desktop\stg_police_situation_nature_ps.txt odps_prod.stg_police_situation_nature_ps/dt='20180724',adcode='330100';
下载数据:tunnel download odps_prod.ods_tfc_area_range_znkk/dt='20180701' C:\Users\Desktop\daduixiaqu.txt;
查看最近的历史记录操作:tunnel show history -n 5;
修改表名:alter table aaa_ps rename to aaa_znkk;
修改表注释:alter table table_name set comment 'table_new_name';
修改表的生命周期:alter table table_name set lifecycle days;(其中day为正整数天)