Re: Bigtable - Fetching multiple keys in one query

130 views
Skip to first unread message

Carlos ORyan

unread,
Nov 30, 2018, 1:31:42 PM11/30/18
to bastien...@nuwa.be, google-cloud-b...@googlegroups.com
Hi,

Thanks for the suggestion.  We definitely need more examples showing how to use the APIs in non-trivial cases.  I have created #1564 for this one.

On Fri, Nov 30, 2018 at 1:05 PM Bastien Duclaux <bastien...@nuwa.be> wrote:
Hello,

I think it would be useful to explain in the documentation that it’s possible to query multiple keys in a single Bigtable query ;

auto row_set=gcb::RowSet();
row_set.Append("red");
row_set.Append("black »);


for (auto const& row : table->ReadRows( move(row_set) , move(gcb::Filter::Latest(1))) )
{       
   auto const& cell = row.cells().front();
   cout<<"Reading "<<cell.value().size()<<" bytes for key "<<cell.row_key())<< endl;
}


I was not obvious, but it’s super useful, and much faster than to do N queries !

Thanks



--
Carlos O'Ryan
GCS Surface & Consumers Team
#include <cute.quote> // TODO(coryan@) actually pick a quote

Reply all
Reply to author
Forward
0 new messages