HBase 테이블에 rowKey로 byte []를 넣었습니다. 이제 내가 사용한 바이트를 기반으로 행을 검색 할 수 있기를 원합니다. 나는 HBase를 쉘을 사용하는 경우, 나는 다음을 수행하십시오hbase rest client get
get 'table', "\x12\x00\x00\x00\x03\x03" and it works fine.
가 지금은 나머지 클라이언트를 사용하는 자바 클래스, GetMyRow.java, 내부의 해당 행을 인출하려고합니다. 내 코드는 다음과 같습니다
byte[] rowKey = new byte[6];
rowKey[0] = 0x12;
rowKey[1] = 0x00;
rowKey[2] = 0x00;
rowKey[3] = 0x00;
rowKey[4] = 0x03;
rowKey[5] = 0x03;
Get g = new Get(rowKey);
Result r = table.get(g);
그리고 나는 다음과 같은 오류가 발생합니다 :
org.apache.commons.httpclient.URIException: escaped absolute path not valid
at org.apache.commons.httpclient.URI.setRawPath(URI.java:2837)
at org.apache.commons.httpclient.URI.parseUriReference(URI.java:2023)
at org.apache.commons.httpclient.URI.<init>(URI.java:167)
at org.apache.hadoop.hbase.rest.client.Client.executePathOnly(Client.java:115)
at org.apache.hadoop.hbase.rest.client.Client.execute(Client.java:164)
at org.apache.hadoop.hbase.rest.client.Client.get(Client.java:284)
at org.apache.hadoop.hbase.rest.client.Client.get(Client.java:257)
at org.apache.hadoop.hbase.rest.client.Client.get(Client.java:242)
at org.apache.hadoop.hbase.rest.client.RemoteHTable.get(RemoteHTable.java:267)
at udf.HBaseConnector.main(GetMyRow.java:74)
모든 아이디어를 어떻게 화장 rowKey 바이트에 따라 행을 인출하는 방법?
hbase의 버전은 무엇입니까? 인쇄 가능한 문자만으로 키를 사용한다면 제대로 작동 할 수 있습니까? –
예, 다른 모든 데이터 유형과 작동합니다. – user1576754
HBase 버전 0.90.4-cdh3u3을 사용 중입니다. – user1576754