Saurabh
Saurabh

Reputation: 73609

How to get specific row in Aerospike from using aql

When I query in Aerospike using following it works:

aql> select * from connekt.inapp

as seen below:

enter image description here

However to find an specific entry I am trying following query, but it does not work:

aql> select * from connekt.inapp where DIGEST = "viwZnPMMutuTZkPBV/PPL6hmWW0="

Error: (2) AEROSPIKE_ERR_RECORD_NOT_FOUND

enter image description here

How to get a specific row from Aerospike using aql.

Upvotes: 2

Views: 450

Answers (2)

pgupta
pgupta

Reputation: 5415

The digest you are seeing "AAAA....=" that was a cosmetic bug in AQL - I believe it was fixed couple of months ago, not sure which version of TOOLS release has it. [Bug - TOOLS-746]

It is rather moot because you already know the digest - you used it in the where = "viwZn...."

BTW, do

$aql aql>HELP

for info on list of commonly used AQL commands. (Where digest= and edigest = are rarely useful in production. AQL is best used for exploring data, creating and managing Secondary Indexes, developing UDFs and Security management)

Upvotes: 4

Saurabh
Saurabh

Reputation: 73609

After doing some research and going through docs, I realised that in my case, digest is in Base64, format, so I have to query using EDIGEST like following:

aql> select * from connekt.inapp where EDIGEST = "viwZnPMMutuTZkPBV/PPL6hmWW0=" 

From docs:

When providing the HEX representation of the digest (for example from the server logs), use DIGEST :

SELECT * FROM [.] WHERE DIGEST='DIGEST_HEX_STRING'

When providing the Base64 representation of the digest (for example from asbackup file), use EDIGEST :

SELECT * FROM [.] WHERE EDIGEST=DIGEST_B64_STRING

However when querying like this, in the result digest is AAAAAAAAAAAAAAAAAAAAAAAAAAA=, which I am not sure why is the case.

enter image description here

Upvotes: 2

Related Questions