上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: Is Flume a good fit for your problem?If you need to ingest textual log data into Hadoop/HDFS then Flume is the right fit for your problem, full stop. For other use cases, here are some guidelines:Flum... 阅读全文
posted @ 2015-06-08 14:33 lishouguang 阅读(8402) 评论(0) 推荐(0)
摘要: select 'hello', x from dual lateral view explode(array(1,2,3,4,5)) vt as x结果是:hello 1hello 2hello 3hello 4hello 5来自为知笔记(Wiz) 阅读全文
posted @ 2015-06-08 14:29 lishouguang 阅读(276) 评论(0) 推荐(0)
摘要: Hive在0.11.0版本开始加入了row_number、rank、dense_rank分析函数,可以查询分组排序后的top值说明:row_number() over ([partition col1] [order by col2])rank() over ([partition col1] [o... 阅读全文
posted @ 2015-06-08 14:27 lishouguang 阅读(11074) 评论(1) 推荐(1)
摘要: Hive + zookeeper 可以支持锁功能锁有两种:共享锁、独占锁,Hive开启并发功能的时候自动开启锁功能1)查询操作使用共享锁,共享锁是可以多重、并发使用的2)修改表操作使用独占锁,它会阻止其他的查询、修改操作3)可以对分区使用锁。1、修改hive-site.xml,配置如下: hive.zookeeper.quorum zk1,zk2,zk3 hive.suppo... 阅读全文
posted @ 2015-06-08 14:25 lishouguang 阅读(2962) 评论(0) 推荐(0)
摘要: create [external] table t1(id int, value string) stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' with serdeproperties('hbase.column.mapping'=':key,f:name');如果想创建一个指向已经存在的HBase表的话,需要使用exte... 阅读全文
posted @ 2015-06-08 14:23 lishouguang 阅读(335) 评论(0) 推荐(0)
摘要: CSVhive-0.14.0内置支持CSV Serde,以前的版本需要引入第三方库的jar包(http://https://github.com/ogrodnek/csv-serde)现在有个文本文件a.csv(从数据库中导出的数据通常都是这种格式),里面的内容如下:[hive@vm1 ~]$ more a.csv '1','zhangsan','20','beijing,shanghai,sha... 阅读全文
posted @ 2015-06-08 14:21 lishouguang 阅读(2002) 评论(0) 推荐(0)
摘要: 1、编写udf类package hive.udf;import org.apache.hadoop.hive.ql.exec.Description;import org.apache.hadoop.hive.ql.exec.UDF;/** * UDF的说明文档 * name是UDF的名称 * value是desc function xx输出的内容 * extended是desc functio... 阅读全文
posted @ 2015-06-08 14:18 lishouguang 阅读(647) 评论(0) 推荐(0)
摘要: SequenceFile是使用二进制保存数据,是可以压缩的,并且压缩后的数据可被分割,可以供mapreduce处理。下面的实例使用SequenceFile保存Hive表的数据,并且使用了压缩。set hive.exec.compress.output=true; #压缩mapreduce输出数据set mapreduce.output.fileoutputformat.compress.codec... 阅读全文
posted @ 2015-06-08 14:15 lishouguang 阅读(866) 评论(0) 推荐(0)
摘要: 表重命名alter table t1 rename to t2;添加分区alter table t1 add if not exists partition(xx=yy) location '/xx';添加多个分区alter table t1 add if not exists partition(x1=y1) location '/x1'partition(x2=y2) location '/x... 阅读全文
posted @ 2015-06-08 14:12 lishouguang 阅读(760) 评论(0) 推荐(0)
摘要: describe简写是desc表desc t1;desc t1 column1;desc extended t1;desc formatted t1;数据库desc database test;分区desc formatted t1 partition(xx=yy);函数desc function xx;desc function extended xx;来自为知笔记(Wiz) 阅读全文
posted @ 2015-06-08 14:10 lishouguang 阅读(672) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 8 下一页