随笔分类 - Hive
摘要:zk kafka mariadb scala flink integrationI do not want to write this paper in the beginning , put the codes onto github.com/git.jd.com,...
阅读全文
摘要:1. mysql jdbc 错误 需要驱动 2. mysql 服务器 ip 错误 即便是本地 也需要用 域名 或 是 ip 不能 用 localhost 等 3. 数据长度 问题 ,hive 乳沟 大于 mysql 错误4. hive 跟 mys...
阅读全文
摘要:hive 数据有时候需要进行数据合并 #!/bin/bashhadoop jar /software/servers/bdp_tools/mergefiles-1.7.jar -u lzo -p hdfs://ns1/user/dd_edw/adm.db/table_...
阅读全文
摘要:The most important parameters of spark env when you using spark run data thingsIn my memory I always confused by these parameters ,s...
阅读全文
摘要:以前所有的Hive 函数都是 Java 或是 Scala 语言写的 ,Python 没有弄个 ,看到Python 格式的 code 懵逼了 ,非常懵逼 今天在看 Python 正则表达式偶遇 Python udf 的一个 case ,不过 Python 484...
阅读全文
Hive error log :FAILED: Execution Error, return code 137 from org.apache.hadoop.hive.ql.exec.mr.Mapr
摘要:From below log is not easy to find the root reason ,any body know that ,thx2018-10-22 03:45:41 INFO 2018-10-22 03:45:41,651 Stage-2(jo...
阅读全文
摘要:记得之前用过一种办法,concat(a.col,'-',ceil(rand()*100)%20)),将记录数特别多的关联字段取模20,得到新字段a.col2;另外维护一张有20条记录的小表,小表的数据从0到19,用b表的关联字段关联这张小表得到新的字段b.col2,然...
阅读全文
摘要:on case when a.user_id is null then concat(‘jd-hive’,rand() ) else a.user_id end = b.user_id;如果两个表join 时 关联键 有众多null 值 ,null值数据会被分发到...
阅读全文
摘要:在京东众多业务中,促销业务充满了复杂性和挑战性,因为业务的灵活性,很多数据都存储成xml和json格式数据,这就要求下游数据分析师们需要对其做解析后方可使用 。在众多操作中 ,有一种是需要对数据做行列转换操作。数据结构:create external table jd...
阅读全文
摘要:# check table 的 partitionhive> show partitions table_name ;如果是外部表 ,不小心把表给删除了 ,可以适用下命令重新关联表和数据[MSCK REPAIR TABLE] 全量修复分区hive> msck repa...
阅读全文
摘要:在大数据处理中经常遇到业务端发送json 数据到 table 里 的情况 ,这个需要数据开发工程师能够准备对json string 进行解析 ,并重新定义新表的结构 。在网络上看到很多网友提到 get_json_object ,json_tuple 的使用和案例 ...
阅读全文
摘要:select explode(Array('row1','row2','...','rown'))Result col_name row1row2...rown
阅读全文
摘要:create table xxxx.test_collect_list_set(first_level_directory int ,second_level_directory int ,third_level_directory int ,order_id in...
阅读全文
摘要:Error :Failed with exception java.io.IOException:org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassCastException: java...
阅读全文
摘要:show create table yourtablename
阅读全文
摘要:在db2 和 oracle 中 ,当我们想知道两张结构相同的table 中,数据差异时候可以采用如下sql :select * from table1 except select * from table2上面语句 求出来的就是 数据在table1 而不再table2...
阅读全文
摘要:Hive的一般学习者和培训者在谈性能优化的时候一般都会从语法和参数这些雕虫小技的角度谈优化,而不会革命性的优化Hive的性能,产生这种现象的原因有:1,历史原因和思维定势:大家学习SQL的时候一般都是就单机DB,这个时候你的性能优化技巧确实主要是SQL语法和参数调优;...
阅读全文
摘要:// 需要引入 hadoop & hive jar import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.Stateme...
阅读全文
摘要:create external table demo (userid int ,name string ,address string)comment 'demo'partitioned by (txdate string ,txhour string)row for...
阅读全文
摘要:1 hive表关联查询,如何解决数据倾斜的问题?倾斜原因:map输出数据按key Hash的分配到reduce中,由于key分布不均匀、业务数据本身的特、建表时考虑不周、等原因造成的reduce 上的数据量差异过大。1)、key分布不均匀;2)、业务数据本身的特性;...
阅读全文

浙公网安备 33010602011771号