MCPcopy Create free account
hub / github.com/apache/arrow / make_cast_options

Function make_cast_options

r/src/compute.cpp:586–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

584}
585
586std::shared_ptr<arrow::compute::CastOptions> make_cast_options(cpp11::list options) {
587 using Options = arrow::compute::CastOptions;
588 auto out = std::make_shared<Options>(true);
589 SEXP to_type = options["to_type"];
590 if (!Rf_isNull(to_type) && cpp11::as_cpp<std::shared_ptr<arrow::DataType>>(to_type)) {
591 out->to_type = cpp11::as_cpp<std::shared_ptr<arrow::DataType>>(to_type);
592 }
593
594 SEXP allow_float_truncate = options["allow_float_truncate"];
595 if (!Rf_isNull(allow_float_truncate) && cpp11::as_cpp<bool>(allow_float_truncate)) {
596 out->allow_float_truncate = cpp11::as_cpp<bool>(allow_float_truncate);
597 }
598
599 SEXP allow_time_truncate = options["allow_time_truncate"];
600 if (!Rf_isNull(allow_time_truncate) && cpp11::as_cpp<bool>(allow_time_truncate)) {
601 out->allow_time_truncate = cpp11::as_cpp<bool>(allow_time_truncate);
602 }
603
604 SEXP allow_int_overflow = options["allow_int_overflow"];
605 if (!Rf_isNull(allow_int_overflow) && cpp11::as_cpp<bool>(allow_int_overflow)) {
606 out->allow_int_overflow = cpp11::as_cpp<bool>(allow_int_overflow);
607 }
608 return out;
609}
610
611// [[arrow::export]]
612SEXP compute__CallFunction(std::string func_name, cpp11::list args, cpp11::list options) {

Callers 3

RecordBatch__castFunction · 0.85
Table__castFunction · 0.85
make_compute_optionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected