<p>I'm working on a project with a friend that will utilize Hbase to store it's data.  Are there any good query examples?  I seem to be writing a ton of Java code to iterate through lists of RowResult's when, in SQL land, I could write a simple query.  Am I missing something?  Or is Hbase missing something?</p>

[{'answer_id': 48112, 'author': 'Sean', 'author_id': 4919, 'author_profile': 'https://Stackoverflow.com/users/4919', 'pm_score': 5, 'selected': True, 'text': '<p>I think you, like many of us, are making the mistake of treating bigtable and HBase like just another RDBMS when it\'s actually a column-oriented storage model meant for efficiently storing and retrieving large sets of sparse data. This means storing, ideally, many-to-one relationships within a single row, for example. Your queries should return very few rows but contain (potentially) many datapoints.</p>\n\n<p>Perhaps if you told us more about what you were trying to store, we could help you design your schema to match the bigtable/HBase way of doing things.</p>\n\n<p>For a good rundown of what HBase does differently than a "traditional" RDBMS, check out this awesome article: <a href="http://blog.csdn.net/arthurbryant/article/details/6643933" rel="nofollow noreferrer">Matching Impedance: When to use HBase</a> by Bryan Duxbury.</p>\n'}, {'answer_id': 48205, 'author': 'David Webb', 'author_id': 3171, 'author_profile': 'https://Stackoverflow.com/users/3171', 'pm_score': 1, 'selected': False, 'text': '<p>I looked at Hadoop and Hbase and as <strong>Sean</strong> said, I soon realised it didn\'t give me what I actually wanted, which was a clustered JDBC compliant database.  </p>\n\n<p>I think you could be better off using something like <a href="http://c-jdbc.objectweb.org/" rel="nofollow noreferrer">C-JDBC</a> or <a href="http://ha-jdbc.sourceforge.net/" rel="nofollow noreferrer">HA-JDBC</a> which seem more like what I was was after.  (Personally, I haven\'t got farther with either of these other than reading the documentation so I can\'t tell which of them is any good, if any.)</p>\n'}, {'answer_id': 147159, 'author': 'zechariahs', 'author_id': 4962, 'author_profile': 'https://Stackoverflow.com/users/4962', 'pm_score': 0, 'selected': False, 'text': "<p>Thanks for the reply Sean, and sorry for my late response.  I often make the mistake of treating HBase like a RDBMS.  So often in fact that I've had to re-write code because of it!  It's such a hard thing to unlearn.</p>\n\n<p>Right now we have only 4 tables.  Which, in this case, is very few considering my background.  I was just hoping to use <em>some</em> RDBMS functionality while mostly sticking to the column-oriented storage model.</p>\n"}, {'answer_id': 153363, 'author': 'Chris', 'author_id': 4742, 'author_profile': 'https://Stackoverflow.com/users/4742', 'pm_score': 1, 'selected': False, 'text': '<p>I\'d recommend taking a look at Apache <a href="http://hive.apache.org/" rel="nofollow noreferrer">Hive</a> project, which is similar to HBase (in the sense that it\'s a distributed database) which implements a SQL-esque language.</p>\n'}, {'answer_id': 1894386, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>Glad to hear you guys are using HBase! I\'m not an expert by any stretch of the imagination, but here are a couple of things that might help.</p>\n\n<ul>\n<li><p>HBase is based on / inspired by BigTable, which happens to be exposed by AppEngine as their db api, so <a href="http://code.google.com/appengine/docs/python/datastore/creatinggettinganddeletingdata.html" rel="nofollow noreferrer">browsing their docs</a> should help a great deal if you\'re working on a webapp.</p></li>\n<li><p>If you\'re not working on a webapp, the kind of iterating you\'re describing is usually handled with via map/reduce (don\'t emit the values you don\'t want). Skipping over values using iterators virtually guarantees your application will have bottlenecks with HBase-sized data sets. If you find you\'re still thinking in SQL, check out cloudera\'s pig tutorial and hive tutorial.</p></li>\n<li><p>Basically the whole HBase/SQL mental difference (for non-webapps) boils down to "Send the computation to the data, don\'t send the data to the computation" -- if you keep that in mind while you\'re coding you\'ll do fine :-)</p></li>\n</ul>\n\n<p>Regards,</p>\n\n<p>David</p>\n'}, {'answer_id': 2663724, 'author': 'Sam Pullara', 'author_id': 2491266, 'author_profile': 'https://Stackoverflow.com/users/2491266', 'pm_score': 2, 'selected': False, 'text': "<p>If you want to access HBase using a query language and a JDBC driver it is possible. Paul Ambrose has released a library called HBQL at hbql.com that will help you do this.  I've used it for a couple of projects and it works well.  You obviously won't have access to full SQL, but it does make it a little easier to use.</p>\n"}]
['https://Stackoverflow.com/questions/48041', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4962/']