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 7975791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:44:32+00:00 2026-06-04T08:44:32+00:00

I am using a scanner to retrieve rows from HBase. I can set which

  • 0

I am using a scanner to retrieve rows from HBase. I can set which columns I want back via the addColumn() method. However, I really need to be able to retrieve a variable number of columns that all start with the same prefix.

So, all the columns I want start with “USA”, for example. I need to retrieve all columns that start with that, such as “USA-Virginia”, “USA-Hawaii”, etc. I do not want values such as “Canada-Quebec”. There are no predefined values for the full column names anywhere. I just need all of them that start with “USA”. Is there a way to get HBase Scanners to do this? I don’t see much in the way of writing custom scanners out there.

I was looking at custom filters, but this just seems to limit the rows I get, as opposed to specifying the columns I want returned. Thoughts?

I cannot change the structure of my data, and all of my data is under a single column family.

Thanks for any ideas. I am running CDH3u4.

  • 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-04T08:44:34+00:00Added an answer on June 4, 2026 at 8:44 am

    What you need is the ColumnPrefixFilter to filter keys by their columns prefix
    http://archive.cloudera.com/cdh/3/hbase/apidocs/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.html

    Something like this should do the trick :-

    filter = new ColumnPrefixFilter(Bytes.toBytes("USA"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is a small program using Java Scanner which reads a file of double
I am trying to read data from a bluetooth barcode scanner (KDC300) using C.
I am using Delphi and trying to read from a bar code scanner over
I'm able to save the captured image from a barcode scanner using this code:
I am using Scanner and BufferedReader objects to read text input from a url,
I am using the scanner class to capture user input from the command line
Im used too using Scanner mainly and want too try using a buffered reader:
I am using the Scanner utility in Java to input data from a file
I'm using the Scanner class to take some input from the user through the
I'm using the scanner method to do work on a string and need to

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.