Support Questions

Find answers, ask questions, and share your expertise

Querying Hbase REST with special characters in rowkey

avatar
New Contributor

Hi guys, 

 

I need your assistance on querying hbase rest with special characters in the rowkey.

 

Hi, I have the following rowkey and data in Hbase:

 

 

ROW                      COLUMN+CELL                                                                                                                                                                                                                                                       
 \xF2member-00002         column=cf:age, timestamp=2022-07-12T10:16:11.986, value=20   

 

 

 

I am querying using the REST interface (version 0.0.3) as:

 

 

GET 'http://localhost:8080/member/%F2member-00002'

 

 

but always getting Not found. 

 

What should be the correct url encoded rowkey?

 

Thanks!

1 ACCEPTED SOLUTION

avatar
Super Collaborator

Hello,

 

Based on the above test, I guess you are hitting HBASE-21852 which is still unresolved in the upstream.

View solution in original post

4 REPLIES 4

avatar
Super Collaborator

Hello,

 

The encoded value for \x would be %5Cx. So can you try using it in the url. Is it connecting via Knox?

 

Also, do upload the curl command output.

avatar
New Contributor

Hi @rki_ , 

 

Thanks for the reply. I have also used standard url encoding but still getting no results. By the way, what is interesting is when I have the following data:

 

ROW                      COLUMN+CELL                                                                                                                                                                                                                                                       
 \xF2member-00002         column=cf:age, timestamp=2022-07-12T10:16:11.986, value=20 
 \x00member-00003         column=cf:age, timestamp=2022-07-12T10:16:11.986, value=20

 I can query \x00member-00003 via curl by replacing \x with %

curl -v -X GET 'http://localhost:8080/member/%00member-00003' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json'

and get results.

{
    "Row": [
        {
            "key": "AG1lbWJlci0wMDAwMw==",
            "Cell": [
                {
                    "column": "TTpwI2FnZQ==",
                    "timestamp": 1657730533731,
                    "$": "MjA="
                }
            ]
        }
    ]
}

 

 

but not this. 

 

curl -v -X GET 'http://localhost:8080/member/%F2member-00002' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json'

It returns Not Found.

 

Also, I am using an hbase standalone docker image (mckdev/hbase:2.4.12).  

 

avatar
Super Collaborator

Hello,

 

Based on the above test, I guess you are hitting HBASE-21852 which is still unresolved in the upstream.

avatar
New Contributor

hi @rki_ , 

 

This must be it.. thanks a lot for the info!