romainfrancois commented on pull request #11369:
URL: https://github.com/apache/arrow/pull/11369#issuecomment-952524533
One of the reasons for the previously seen problem is that the type
inference from an R character vector to either `utf8()` or `large_utf8()` is
(too?) cautious:
```cpp
template <>
std::shared_ptr<arrow::DataType> InferArrowTypeFromVector<STRSXP>(SEXP x) {
return cpp11::unwind_protect([&] {
R_xlen_t n = XLENGTH(x);
int64_t size = 0;
for (R_xlen_t i = 0; i < n; i++) {
size += arrow::r::unsafe::r_string_size(STRING_ELT(x, i));
if (size > arrow::kBinaryMemoryLimit) {
// Exceeds 2GB capacity of utf8 type, so use large
return large_utf8();
}
}
return utf8();
});
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]