Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8197365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:43:31+00:00 2026-06-07T05:43:31+00:00

I cannot figure out how to use filters in the HBase REST interface (HBase

  • 0

I cannot figure out how to use filters in the HBase REST interface (HBase 0.90.4-cdh3u3). The documentation just gives me a schema definition for a “string”, but doesn’t show how to use it.

So, I’m able to do this:

curl -v -H 'Content-Type: text/xml' -d '<Scanner startRow="ddo" stopRow="ddp" batch="1024"/>' 'http://hbasegw:8080/table/scanner'

and then retrieve with

curl -s -H "Content-Type: text/xml" http://hbasegw:8080/table/scanner/13293426893883128482b | tidy -i -q -xml

But now I want to use a SingleColumnValueFilter and have to encode that somehow in the XML.
Does anyone have an example for this?

Thanks,
Mario

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:43:34+00:00Added an answer on June 7, 2026 at 5:43 am

    Filter fields in the Scanner XML are strings formatted as JSON. Since the JSON for the filter has many quotes in it, I recommend using a separate file for curl’s -d parameter, to avoid the single quote.

    curl -v -H "Content-Type:text/xml" -d @args.txt http://hbasegw:8080/table/scanner

    Where the file args.txt is:

    <Scanner startRow="cm93MDE=" endRow="cm93MDg=" batch="1024">
        <filter>
        {
            "latestVersion":true, "ifMissing":true, 
            "qualifier":"Y29sMQ==", "family":"ZmFtaWx5", 
            "op":"EQUAL", "type":"SingleColumnValueFilter", 
            "comparator":{"value":"MQ==","type":"BinaryComparator"}
        }
        </filter>
    </Scanner>
    

    How do you discover how the JSON filter string should look like? Here’s an easy way through Java code that spits out the stringified filter given a standard Filter object from HBase’s Java API.

    SingleColumnValueFilter filter = new SingleColumnValueFilter(
        Bytes.toBytes("family"),
        Bytes.toBytes("col1"),
        CompareFilter.CompareOp.EQUAL,
        Bytes.toBytes("1")
    );
    System.out.println(ScannerModel.stringifyFilter(filter));
    

    Notice that the JSON and the XML require data encoded in Base64. I’ve tested the above curl command on a table and it worked just fine.

    In case you are wondering, yes, the REST API for scanners is not yet as developer-friendly as it can get.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've looked around on google and I cannot figure out to use for instance
I'm starting to use Moq and I cannot figure out how to test the
I cannot figure out how to use the wp_list_categories function to do what I
I would like to use Ninject in my WinForms application. I cannot figure out
I cannot figure out how I can use reverse find in Xcode 4. Back
I cannot figure out why, but when I use an OleDbDataAdapter or OleDbCommand to
I cannot figure out how to use FastMM. I have downloaded it from SourceForge
I use a Mahout (version 0.8) and MySQL. I can not figure out how
Cannot figure out, where to change EOF in PyCharm. My scripts start with :
I cannot figure out this positioning problem in Firefox. It doesn't seem to follow

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.