Rife
Rife

Reputation: 555

HBASE how to use page, sort, order in REST API?

my hbase version is hbase-0.92.1 . I have started rest daemon, and can get right result through get /table/row rest api like offical document:

curl -vi -X GET \
  -H "Accept: text/xml" \
  "http://example.com:8000/users/row1"

but my question is how to use page sort order in query?

such as: "count" is a column family, "flows" and "views" are columns in this family, if I want to query order by "views" , how to do that?

Upvotes: 0

Views: 327

Answers (1)

Nishu Tayal
Nishu Tayal

Reputation: 20860

If you want to sort the entire table based on "count:view" column, you may require SCAN instead of GET operation.

In REST API, the results are always an ascending order of keys that retrieves the oldest rows first.

However there is a feature request for the same having reverse sort also: https://community.hortonworks.com/content/supportkb/195908/the-hbase-rest-api-sorting-order-reverse-sorting-i.html https://issues.apache.org/jira/browse/HBASE-16299

You can check the version supporting it.

Upvotes: 0

Related Questions