hive_sql
喝醉的鱼儿
励志做一名很出色的程序员
展开
-
hive 时间函数 from_unixtime unix_timestamp 时间格式转换 yyyyMMdd yyyy-MM-dd HH:mm:ss
unix_timestamp函数用法:返回当前时间的时间戳 from_unixtime函数用法:把当前时间戳转换成时间格式 获取当下的时间戳如下: 时间戳转换如下: 如果想要获得当前时间直接可以更简单 current_timestamp :获取当前时间 但是我想要的不是这种,'yyyy-MM-dd HH:mm:ss'格式,是'yyyyMMdd呢 我看网上其他人是这样写的 from_unixtime(current_tim...原创 2021-09-18 11:49:18 · 3440 阅读 · 0 评论 -
hive sql 执行顺序 与MySQL对比
在hive SQL中 select 不能控制group by 和 having 聚合函数的条件;而MySQL却可以。 其书写顺序执行顺序如下:原创 2021-09-09 10:26:58 · 477 阅读 · 0 评论 -
hive 数仓 增删改查 sql 语句
1、建分区表 (多个字段入hive,其原数据字段是啥分隔符符号,入hive就要是啥分隔符) create table table_name (num_id string comment '手机号',if_activestring comment '是否活跃') partitioned by (statis_date string) row format delimited fields terminated by '\t'; 2、查看表下所有的分区 show partitions table_na..原创 2021-09-09 10:13:03 · 840 阅读 · 0 评论