meztez
November 15, 2020, 5:14pm
1
Building a BigQuery Storage Client.
Using message.SerializeToString gets me a std::string but I actually want that to remains in raws format instead character when returning to R.
See here : https://github.com/meztez/bigrquerystorage/blob/77102bd8f34080869580e174e81e49875a4833a1/src/bqs.cpp#L152
Willl keep reading doc, but if someone any has pointer. That would be great.
1 Like
meztez
November 15, 2020, 6:16pm
2
Or a uint_8t array into raws
meztez
November 16, 2020, 5:15pm
3
cpp11::raws to_raw(const std::string input) {
cpp11::writable::raws rv(input.size());
for(unsigned long i=0; i<input.size(); i++) {
rv[i] = input.c_str()[i];
}
return rv;
}
I ended up using Rcpp instead and switched to a faster algo
// append std::string at the end of a std::vector<uint8_t> vector
void to_raw(const std::string input, std::vector<uint8_t>* output) {
output->insert(output->end(), input.begin(), input.end());
}
system
Closed
November 23, 2020, 5:15pm
4
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.