Gary
Gary

Reputation: 21

How to delete records in Accumulo based on an rowkey via Accumulo proxy client

I'm using Accumulo 1.6 and want to delete some records by a giving rowkey via accumulo proxy client in nodejs.

but the proxy client throw "start row must be less than end row" when I trying to put same rowkey into the deleteRows API

var rowId = "1";
var proxyClient = getAccumuloProxyClient();
proxyClient.deleteRows(getLogin(), TABLE_NAME, rowId, rowId, callback);

UPDATE: Let's say there is a table looks like:

rowID | columnFamily | columnQualifier
1        name           John
1        age            25
1        department     sales
2        name           Lisa
2        age            25  
2        department     sales

what parameters should I pass to the deleteRows function if I want to delete all of rows of rowID equals 1? I tried pass 1 to start and end, but it complain

"org.apache.accumulo.core.client.AccumuloException: start row must be less than end row"

then I tried to pass start = 1 and end = 1\0 to make sure start less than end, but nothing happend, no error threw, no rows deleted. I think that caused by the start is exclude and end is include for deleteRows. So I'm confused about how to delete one record(which rows has same rowID).

Upvotes: 1

Views: 523

Answers (1)

Gary
Gary

Reputation: 21

for my case using (char - 1 as the start row is solved my problem:

var startRowId = rowId.substring(0, rowId.length - 1) + String.fromCharCode(rowId.charCodeAt(rowId.length - 1) - 1);
proxyClient.deleteRows(getLogin(), TABLE_NAME, startRowId, rowId, callback);

Upvotes: 1

Related Questions