Multiple Prefix Search Scan

86 views
Skip to first unread message

Chintan Gandhi

unread,
Dec 23, 2019, 2:26:42 PM12/23/19
to Google Cloud Bigtable Discuss
In BigTable, The rowkey looks like below

ABC|jayuqhchypkywydocfssmueqqbojckkn
ABC|icjrphyzwepvrhnfxklayyupeqentcmh
ABC|dyyvpoibivjiwomgucrpgiqpwkhsffkb

PQR|tuxofdddaleixoudghwnmbklevooxxck
PQR|mfpyhhxlsnfcaiktdyooydekyvspcwpy

MNO|wvhusiwpwcovsegbswwriuiydjvbreuf
MNO |nxxlqovxhgluyykbvbccpefjtkvadabe
MNO |hfazldxqyvcektlizrtgxetfzthpdije

XYZ|jsbnjujvrtqfpirxqpzizchhlkwpbfeo
XYZ|pqldqjzoytknwsqybpnldezaoaevbrbb

In Java, I want to fetch All rows who can start with multiple Keys. 

For example, I would like to fetch all rows which start with PQR and XYX in same call rather than having multiple Scans calls. I could have this list of keys in 100s. If I do individual calls. This could be quiet an impact on us.

PQR|tuxofdddaleixoudghwnmbklevooxxck
PQR|mfpyhhxlsnfcaiktdyooydekyvspcwpy
XYZ|jsbnjujvrtqfpirxqpzizchhlkwpbfeo
XYZ|pqldqjzoytknwsqybpnldezaoaevbrbb

Please guide me on how to do this or point me to an example.



Ramesh Dharan

unread,
Dec 24, 2019, 10:56:37 AM12/24/19
to Google Cloud Bigtable Discuss
Hi Chintan, 

You can use the ReadRows API to achieve this, by passing multiple row ranges in the RowSet.

For more specific details we'll need to know which language/client library you are using. Please also consider posting this question on Stack Overflow using the google-cloud-bigtable tag; questions there are automatically triaged and answered by our engineering and support teams.

Thanks, 

--Ramesh


Reply all
Reply to author
Forward
0 new messages