Darn, thought that might work, but it didn’t. I actually think that’s one of the ways I originally tried (using the “0x” with no quotes).
The problem is that
INSERT INTO namespace.setName (PK, someBinName) VALUES (0xDEADFACE, 10)
isn’t equivalent to
byte[] keyValue =
{
(byte)0b11011110, // 0xDE
(byte)0b10101101, // 0xAD
(byte)0b11111010, // 0xFA
(byte)0b11001110 // 0xCE
};
Key newKey = new Key("namespace", "setName", keyValue);
// *Note* that default write policy has sendKey=true
client.put(null, newKey, new Bin("someBinName", 10));
Because after running both of those, in aql I see this:
aql> select * from namespace.setName
+-------------+-------------+
| PK | someBinName |
+-------------+-------------+
| 3735943886 | 10 |
| DE AD FA CE | 10 |
+-------------+-------------+
The PK=3735943886 row is from the aql INSERT command, while the PK=“DE AD FA CE” row is from my application.
From the “explain select…” command, I can somewhat see the issue.
The KEY_TYPE for the PK=3735943886 row is INTEGER, but for the PK=“DE AD FA CE” row, it’s BASE64_DIGEST.
Also, for the PK=3735943886 row, POLICY_KEY=AS_POLICY_KEY_SEND, while for the PK=“DE AD FA CE” row, it’s AS_POLICY_KEY_DIGEST.