resthadoophbasestargatenosql

How to get rows in reversed order in HBase REST curl


I can get all rows from a table with

curl -H "Accept: application/json" http://localhost:8080/table/*

I can limit the rows number with

curl -H "Accept: application/json" http://localhost:8080/table/*?limit=10

The problem is the rows are always the first 10 inserted and not the last 10.

I wonder to get reversed order, specially combined with the limit parameter.

I know about the setReversed parameter and in HBase shell this works fine:

scan 'table', {LIMIT => 10, REVERSED=> TRUE}

Solution

  • Looks like it wasn't implemented in older versions but patch is available.

    Here is the related JIRA ticket

    Eventually it should be

    curl -H "Accept: application/json" http://localhost:8080/table/*?limit=10&reversed=true