File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export(int64)
2929export(int8)
3030export(list_of)
3131export(null)
32+ export(read_arrow)
3233export(read_record_batch)
3334export(record_batch)
3435export(schema)
@@ -42,6 +43,7 @@ export(uint32)
4243export(uint64)
4344export(uint8)
4445export(utf8)
46+ export(write_arrow)
4547importFrom(R6,R6Class)
4648importFrom(Rcpp,sourceCpp)
4749importFrom(assertthat,assert_that)
Original file line number Diff line number Diff line change @@ -78,6 +78,15 @@ array <- function(...){
7878 RecordBatch_to_dataframe(x )
7979}
8080
81+ # ' @export
82+ write_arrow <- function (data , path ){
83+ record_batch(data )$ to_file(path )
84+ }
85+
86+ # ' @export
87+ read_arrow <- function (path ){
88+ as_tibble(read_record_batch(path ))
89+ }
8190
8291# ' Create an arrow::RecordBatch from a data frame
8392# '
Original file line number Diff line number Diff line change @@ -159,8 +159,6 @@ List RecordBatch_to_dataframe(const std::shared_ptr<arrow::RecordBatch>& batch){
159159 return tbl;
160160}
161161
162-
163-
164162// [[Rcpp::export]]
165163std::shared_ptr<arrow::Table> dataframe_to_Table (DataFrame tbl){
166164 auto rb = dataframe_to_RecordBatch (tbl);
You can’t perform that action at this time.
0 commit comments