Skip to main content
EJB
Silver ⭐️⭐️
July 12, 2022
Solved

Querying Hbase REST with special characters in rowkey

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!

rki_
rki_Answer
Gold ⭐️
July 13, 2022

Hello,

 

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

4 replies

rki_
Gold ⭐️
Gold ⭐️
July 13, 2022

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.

Translate
EJB
EJBAuthor
Silver ⭐️⭐️
July 13, 2022

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).  

 

Translate
rki_
Gold ⭐️
rki_Answer
Gold ⭐️
July 13, 2022

Hello,

 

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

Translate
EJB
EJBAuthor
Silver ⭐️⭐️
July 14, 2022

hi @rki_ , 

 

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

Translate