hive删除hbase数据_hive结合hbase数据处理解决方案测评二(优化篇)

count

select count(1) from hbase_table;

部分字段切表

insert overwrite table hive_table select a,b,c,d from hbase_table;

全字段切表

insert into table test_table partition(part='aa') select * from hbase_table;

hive至hive切表

create table test_table2 like test_table;

insert into table test_table2 partition(part) select * from test_table;

优化修改参数

hbase.regionserver.handler.count

100

Count of RPC Listener instances spun up on RegionServers.

Same property is used by the Master for count of master handlers.

Default is 10.

hfile.block.cache.size

0.4

Percentage of maximum heap (-Xmx setting) to allocate to block cache

used by HFile/StoreFile. Default of 0.25 means allocate 25%.

Set to 0 to disable but it's not recommended.

hbase.client.scanner.caching

1000

Number of rows that will be fetched when calling next

on a scanner if it is not served from (local, client) memory. Higher

caching values will enable faster scanners but will eat up more memory

and some calls of next may take longer and longer times when the cache is empty.

Do not set this value such that the time between invocations is greater

than the scanner timeout; i.e. hbase.regionserver.lease.period

切表

优化前后字段全量与否case数据量cpu cost(minutes,seconds)执行cost(seconds)

前部分hbase->hive161637410 , 18359.162

后部分hbase->hive16163743 , 24281.975

后部分hbase->hive16163742 , 38232.391

后部分hbase->hive26086264 , 39263.206

后全量hbase->hive26086267 , 53820.914

后部分hbase->hive1223052813 , 22765.262

后全量hbase->hive1223052822 , 591305.236

后全量hive->hive1223052810 , 41580.522

count

优化前后表类型数据量cpu cost(minutes,seconds)执行cost(seconds)

优化前hbase161637410 , 45728.647

hive16163740 , 2564.815

优化后hbase16163744 , 9609.28

优化后hbase1223052813 , 10907.44

hive122305283 , 18422.138

总结

hive&hbase表的统计计算性能远低于hive表的统计计算,相差3倍乃至以上。

hbase参数优化前后有查询统计效率成倍提升,但与hive表相比也存在差距。

hive&hbase表切成hive表部分字段由于全量字段。

...

综上,hive的hbase存储结构不善于统计计算;hive表的hbase存储结构切换成hive普通的存储结构,随着数据量增加,性能也令人堪忧(如上测试也可以看到,即使是hive与hive表的切表数据量大也是很耗时的)。hbase方案具体是选择居于hive&hbase表统计计算,还是选择hive&hbase表切换成hive表后统计计算,需要权衡,或者是否有其他更好hive与hbase关联方案,需要继续研究。

分析:随着数据量越来越大,每天都进行hbase—>hive的切表,这是不切合实际的选择,但终究我们需要将hbase表转化成hive表,或许我们可以选择数据“冷热”、以及部分字段切表来优化。

备注:测试还不全面,待完善,特别是hive&hbase复杂sql的统计计算。

分享到:

2012-12-06 09:41

浏览 6049

评论

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值