常用的 hive 语句
cast 强制类型转换
cast(info as BIGINT)concat_ws 字符串的链接
concat_ws('-',year,month,day)split 字符串的分割
split(info,',')lateral view explode 字符串的延展
lateral view explode(split(param['info'],'\;')) snTable as split_infounix_timestamp 日期转毫秒
(unix_timestamp(start_time)-unix_timestamp(end_time))/60 (分钟)case
case when a>1 then 1 when a>=1 and a<2 then 2 else 3 end as tmpfrom_unixtime 毫秒转日期
from_unixtime(1511022000,'yyyy-MM-dd HH:mm:ss')select 未命名的列 _c0
select sum(_c0) from table得到行号 row_umber()
select name, row_umber() over() from stu_table;展示一个表创建时候的信息
show create table student_talbe;查看一个表的所有的字段名
show full columns from question
常用的 MySql
将 MySql 中的一个数据库 student 导出到本地
mysqldump -P端口号 -h写IP -u用户名 -p密码 --databases student > dump.txt将本地的 dump.txt 上传到数据库中
musqldump