hive 解jason字符串
摘要:json 字符串为: 字段名为: json {"appId":36222,"deviceId":"12536521-7b3d-41f6-9c09-fdb94b1098a6","md":"{\"os\":\"Android\",\"imei\":\"351834334\",\"nt\":\"wifi\
阅读全文
hive 抽样方法
摘要:select * from (select *from advert.dws_advert_order_model_sample_pcvr_v2_diwhere dt>= date_sub('${date}',7) and dt< '${date}'and ((label >=0.5 and ran
阅读全文
hive 显示分区
摘要:显示某一张表的分区值 show partitions table_name;
阅读全文
hive中分号问题
摘要:分号是sql的结束符,在hql中亦如此,但是hive对分号的识别没有那么智能,如下: select concat(';','aa') from lhc limit 1; FAILED: Parse Error: line 1:13 cannot recognize input near '<EOF>
阅读全文
建分区外表 自动导入数据
摘要:建表后增加分区,数据自动导入 create external table gid_tag_1114 (a1 string ,b1 string,c1 string ) partitioned by (day int) row format delimited fields terminated by
阅读全文
hive字符串函数
摘要:https://zhidao.baidu.com/question/136812310131554325.html
阅读全文
hive sql split 分隔符
摘要:Hive字符串分割函数 split(str, regex) - Splits str around occurances that match regexTime taken: 0.769 seconds, Fetched: 1 row(s) 返回值为一个数组 a.基本用法: 例1: split('
阅读全文
hivepython 实现一行转多行
摘要:案例1: ==效果等同于一行转多行 数据表名称:zhangb.gid_tags 数据格式,每行是2个字段,(gid,tags) ,可能有脏数据,分隔符为“\t”, ANDROID-9de77225cadb4319adfc1b1fe51c54f0 h65010000,014200,018100,011
阅读全文
一行转多行 及多行转一行的 hive语句
摘要:注意 :|,; 是特殊符号,要用 "\\|", "\\;"来表示。 一行转多行 usertags 里面有很多项,每项之间以逗号分隔 create table tag_count2 as select tag,count(gid) from ( select gid,tag from (select
阅读全文
hive sql 随机抽样
摘要:create table daizk.IOS_matrix_sex asselect *from zhujx.1029_IOS_features_replce_nullwhere sex = 'M'union allselect *from zhujx.1029_IOS_features_replc
阅读全文
hive sql 效率提升
摘要:转 : http://www.cnblogs.com/xd502djj/p/3799432.html hive的查询注意事项以及优化总结 . Hive是将符合SQL语法的字符串解析生成可以在Hadoop上执行的MapReduce的工具。使用Hive尽量按照分布式计算的一些特点来设计sql,和传统关系
阅读全文
hive 排序 分组计数后排序 几种不同函数的效果
摘要:【转至:http://blackproof.iteye.com/blog/2164260】 总结: 三个分析函数都是按照col1分组内从1开始排序 (假设4个数,第2和第3个数据相同) row_number() 是没有重复值的排序(即使两天记录相等也是不重复的),可以利用它来实现分页 比如:1、2、
阅读全文
hive\hadoop 常用命令
摘要:—1—————— 后台跑程序语句: 在shell下输入: nohup hive -f aaa.sql >bbb.log 2>&1 & 然后把sql 的脚本导入服务器上:Transfer—Zmodem upload List 相关命令:jobs:可以看到运行的任务,;cat bbb.log 可以看到这
阅读全文