You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/12/03 10:31:05 UTC

[GitHub] [arrow] romainfrancois commented on pull request #11783: ARROW-14894: [R] Integer overflow in write_parquet chunk size calculation

romainfrancois commented on pull request #11783:
URL: https://github.com/apache/arrow/pull/11783#issuecomment-985405738


   I agree with @jonkeane about factoring out in a separate function and then test that function. 
   
   @paleolimbot yeah indeed `$num_rows` gives an `int`: 
   
   ```cpp
   // [[arrow::export]]
   int Table__num_rows(const std::shared_ptr<arrow::Table>& x) { return x->num_rows(); }
   ```
   
   As a short term, perhaps it could instead be: 
   
   ```cpp
   // [[arrow::export]]
   SEXP Table__num_rows(const std::shared_ptr<arrow::Table>& x) {
     auto out = x->num_rows();
   
     if (out > std::numeric_limits<int>::max()) {
       return Rf_ScalarReal(out);
     } else {
       return Rf_ScalarInteger(out);
     }
   }
   ```
   
   although that can probably be better supported by `cpp11` somehow. 
   
   
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org