tikv / website

Website for tikv.org
19 stars 62 forks source link

TiKV in 5 minutes docs code with Python client does not work for batch get for Raw KV #286

Closed karuppiah7890 closed 3 years ago

karuppiah7890 commented 3 years ago

Change Request

https://tikv.org/docs/5.1/concepts/tikv-in-5-minutes/ has python code for raw kv, with name test_raw.py and this code produces this output -

$ python3 test_raw.py 
b'Hello'
None
[(b'k1', b'Hello'), (b'k2', b','), (b'k3', b'World'), (b'k4', b'!'), (b'k5', b'Raw KV')]

Note the None for the batch get result, where the code is print(client.batch_get([b"k1", b"k3"]))

Describe the problem

Suggest an improvement/fix

Not sure what the improvement here is, I haven't debugged or deep dived into the problem. If I find anything, I'll post here

karuppiah7890 commented 3 years ago

For similar code using Transactional KV API, batch get worked and the output was like this -

$ python3 test_txn.py 
b'Hello'
[(b'k1', b'Hello'), (b'k3', b'World')]
[(b'k1', b'Hello'), (b'k2', b','), (b'k3', b'World'), (b'k4', b'!'), (b'k5', b'TXN KV')]

Note how the output is [(b'k1', b'Hello'), (b'k3', b'World')] for the batch get

marsishandsome commented 3 years ago

@andylokandy PTAL

marsishandsome commented 3 years ago

@karuppiah7890 please install tikv-client using pip3 install tikv-client. this bug is fixed in tikv-client v0.0.2

karuppiah7890 commented 3 years ago

Awesome! Thanks @marsishandsome !