I’m using a Java application to write/read records. It inserts a record with the key in the form of a byte array as illustrated with the following code, where client is an AerospikeClient object:
void insertRow(byte[] keyValue)
{
Key newKey = new Key("namespace", "setName", keyValue);
client.put(null, newKey, new Bin("someBinName", 10));
}
In the client’s default write policy, I have sendKey = true, which allows me to see the PK column in the AQL shell with a select, as follows:
aql> select * from namespace.setName
+-------------------------------------------------+-------------+
| PK | someBinName |
+-------------------------------------------------+-------------+
| ED D9 9E 1B 49 87 AF 4D BA 5C F3 5A 26 30 E6 13 | 10 |
+-------------------------------------------------+-------------+
With sendKey=false, the PK client was absent. So it’s cool that I can now see the PK column.
But I can’t do a “select where” with the PK.
aql> select * from namespace.setName where PK='EDD99E1B4987AF4DBA5CF35A2630E613'
Error: (2) AEROSPIKE_ERR_RECORD_NOT_FOUND
I’ve tried every format I can come up with. Spaces between the bytes (as shown in the first select result), without, surrounding double quotes, single quotes, no quotes, etc. No dice.
Anyone know if it’s even possible? Is the PK that is displayed in AQL not the actual PK (it’s a “user” key?) and therefore not the one I should be using (in which case, there’s not really any point in setting sendKey=true, at least for my purposes, since I don’t need to see the PK column in AQL, I just need to be able to query with it using the known key values that I’m using to insert, and I thought sendKey might allow that)?