
SQL
文章平均质量分 51
继续微笑lsj
眼界决定未来
展开
-
hive regexp_extract
函数描述:regexp_extract(str, regexp[, idx]) - extracts a group that matches regexp字符串正则表达式解析函数。-- 这个函数有点类似于 substring(str from 'regexp') ..参数解释:其中:str是被解析的字符串regexp 是正则表达式转载 2016-06-13 11:48:54 · 1637 阅读 · 0 评论 -
笔记1
1) 求门店每月在线天数select substring(hp_stat_time, 1,7) as month ,shopid, sum(case when charge >0 then 1 else 0 end) as online_day_cnt,sum(charge)from () a where buname="test" group by substring(原创 2016-05-24 09:12:34 · 563 阅读 · 0 评论 -
hive order by,sort by,distributed by
order byorder by 会对输入做全局排序,因此只有一个reducer(多个reducer无法保证全局有序)只有一个reducer,会导致当输入规模较大时,需要较长的计算时间。set hive.mapred.mode=nonstrict; (default value / 默认值)set hive.mapred.mode=strict; order b转载 2016-06-13 18:16:04 · 1237 阅读 · 1 评论 -
Mysql的row_format
问题描述:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'variabaes like "%per_table%"'解决方案:前段时间在项目压测的时候出现转载 2016-07-12 12:39:35 · 21509 阅读 · 2 评论 -
hive 时间函数
语法: from_unixtime(bigintunixtime[, string format])返回值: string 说明: 转化UNIX时间戳(从1970-01-01 00:00:00 UTC到指定时间的秒数)到当前时区的时间格式 举例: hive>selectfrom_unixtime(1323308转载 2016-06-22 17:12:11 · 1054 阅读 · 0 评论