大数据

Phoenix使用注意事项以及跟标准sql的不同

2018-06-12  本文已影响66人  4ea0af17fd67

phoenix是一个客户端的库,它在HBase基础上提供SQL功能层,让我们可以使用标准的JDBC接口操作HBase。
全部支持的特性可以浏览官方最新版本支持的SQL语法,下面列举一些phoenix 4.6版本不支持的特性及与普通MySQL SQL用法有差异的地方。

UPSERT INTO table(id, col1) SELECT id, 'val1' FROM table WHERE col2 = val2

java.util.Date cannot be cast to org.apache.phoenix.schema.types.PhoenixArray

Phoenix’s Connection objects are different from most other JDBC Connections due to the underlying HBase connection. The Phoenix Connection object is designed to be a thin object that is inexpensive to create. If Phoenix Connections are reused, it is possible that the underlying HBase connection is not always left in a healthy state by the previous user. It is better to create new Phoenix Connections to ensure that you avoid any potential issues.

优化:

由于phoenix本质上在HBase读写数据,所以HBase集群的性能影响是最大的,一般使用多节点(一般hadoop集群节点要大于等于5个)、SSD、更大的内存与缓存和对phoenix/hbase/hadoop配置参数进行调优能获得更大性能的提升。下面列举一些针对phoenix的优化措施:

作者:伍世志
链接:https://www.jianshu.com/p/2a6c06522971
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

上一篇下一篇

猜你喜欢

热点阅读