phoenix 根据条件更新_用 Phoenix 通过 SQL 语句更新操作 HBase 数据

(点击上方公众号,可快速关注)

作者:伯乐在线 - ixirong

blog.jobbole.com/101003/

HBase 提供很方便的shell脚本,可以对数据表进行 CURD 操作,但是毕竟是有一定的学习成本的,基本上对于开发来讲,sql 语句都是看家本领,那么,有没有一种方法可以把 sql 语句转换成 hbase的原生API呢? 这样就可以通过普通平常的 sql 来对hbase 进行数据的管理,使用成本大大降低。

Apache Phoenix 组件就完成了这种需求,官方注解为 “Phoenix – we put the SQL back in NoSql”,通过官方说明,Phoenix 的性能很高,相对于 hbase 原生的scan 并不会差多少,而对于类似的组件 hive、Impala等,性能有着显著的提升,详细请阅读 https://phoenix.apache.org/performance.html。

Apache Phoenix 官方站点:https://phoenix.apache.org/Phoenix支持的sql语句: https://phoenix.apache.org/language/index.htmlPhoenix 支持的DataTypes:https://phoenix.apache.org/language/datatypes.htmlPhoenix 支持的函数:https://phoenix.apache.org/language/functions.html

一、安装使用

Phoenix 安装很简单,下载对应hbase版本的Phoenix,以phoenix-4.4.0-HBase-0.98-bin.tar.gz为例,解压文件,将phoenix-4.4.0-server.jar 拷贝到hbase安装目录的lib下,注意:每台regionserver均需要拷贝,重启hbase server即可,官方如下:

download and expand the latest phoenix-[version]-bin.tar.

Add the phoenix-[version]-server.jar to the classpath of all HBase region server and master and remove any previous version. An easy way to do this is to copy it into the HBase lib directory (use phoenix-core-[version].jar for Phoenix 3.x)

restart the region servers

Add the phoenix-[version]-client.jar to the classpath of a

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值