Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Hbase query best practice

avatar
Contributor

As Hbase has no its build-in query language, I'm wondering the best practice of hbase query..by spark, Phoenix, solar? We need select, group by, join operations mostly. How to decide which technique is right for our case?

1 ACCEPTED SOLUTION

avatar

@Cui Lin

If you have to perform huge scans and joins between big tables, you can also consider creating hive tables using hbase storage handler and using hive to perform your sql queries.

See examples below:

https://community.hortonworks.com/questions/1558/bestoptimized-way-to-move-data-from-phoenix-to-hiv....

https://community.hortonworks.com/questions/1652/how-can-i-query-hbase-from-hive.html

View solution in original post

6 REPLIES 6

avatar
Master Mentor

avatar
Master Mentor

@Cui Lin

and you can configure Squirel or DBVisualizer using phoenix jdbc driver.

http://www.dbvis.com/doc/8.0/doc/ug/installDriver/installDriver.html

avatar
Contributor

Apache Phoenix is currently the only way to query HBase using SQL.

avatar

@Cui Lin

If you have to perform huge scans and joins between big tables, you can also consider creating hive tables using hbase storage handler and using hive to perform your sql queries.

See examples below:

https://community.hortonworks.com/questions/1558/bestoptimized-way-to-move-data-from-phoenix-to-hiv....

https://community.hortonworks.com/questions/1652/how-can-i-query-hbase-from-hive.html

avatar
Contributor

I tried Phoenix and installed it according to the instruction, but I got the following error message:

[root@cui-hdp-02 phoenix]# sqlline.py localhost Setting property: [isolation, TRANSACTION_READ_COMMITTED] issuing: !connect jdbc:phoenix:localhost none none org.apache.phoenix.jdbc.PhoenixDriver Connecting to jdbc:phoenix:localhost

15/12/15 14:17:14 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

15/12/15 14:17:14 WARN impl.MetricsConfig: Cannot locate configuration: tried hadoop-metrics2-phoenix.properties,hadoop-metrics2.properties 15/12/15 14:17:15 ERROR client.ConnectionManager$HConnectionImplementation: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.

My hbase's znode is by default defined as /hbase-unseure. How can i change phoenix to use current znode, instead of /hbase?

avatar
Master Mentor

@Cui Lin Could you accept one of the answers related to originial question and post this as new thread? It will help to keep the flow clean.