Commits


Romain Francois authored and Wes McKinney committed 894b6e70d6e
ARROW-3814: [R] RecordBatch$from_arrays() This started out as an implementation of `RecordBatch$from_arrays()` (i.e. https://issues.apache.org/jira/browse/ARROW-3814?filter=12344983) but now looks more like this issue: https://issues.apache.org/jira/browse/ARROW-3815?filter=12344983 The idea being that the record batch factory `record_batch()` would work with `...` and `schema`, where each thing in the `...` could be: - an `arrow::Array` - an R vector that can be converted to an array using `array()` So where we had this before: ```r record_batch(tibble::tibble(x = 1:10, y = 1:10)) ``` we would now have: ```r record_batch(x = 1:10, y = 1:10) ``` We would still be able to start from a data frame, via splicing, e.g.: ``` tbl <- tibble::tibble(x = 1:10, y = 1:10) record_batch(!!!tbl) ``` So there would be no need for a `RecordBatch$fromArray()` method. Author: Romain Francois <romain@purrple.cat> Author: Wes McKinney <wesm+git@apache.org> Closes #3565 from romainfrancois/ARROW-3814/record_batch_from_arrays and squashes the following commits: ab0cd1626 <Romain Francois> only pass $1 to run_clang_format so that we can do: 6ea077883 <Romain Francois> rebase f27dcb9fe <Wes McKinney> Also run cpplint and clang-format on .cpp files 2362ea0e7 <Romain Francois> typo eed535f6a <Romain Francois> add comments about !!! efd84c506 <Romain Francois> record_batch(schema=) compares names 457494266 <Romain Francois> STOP_IF migth be useful too c04f904c9 <Romain Francois> tests about record_batch(schema=) argument fc885fda7 <Romain Francois> directly return from builder_->Finish(), as suggested here: https://github.com/apache/arrow/pull/3635/files/08b295370271f122b410b991282b4919510b5cea#r261012517 d958108c9 <Romain Francois> record_batch(..., schema = ) d8e627fb4 <Romain Francois> use the schema= argument in table() 68744f5d2 <Romain Francois> tests for table(...<vectors, arrays, chunked arrays>) 7e8a4b7d8 <Romain Francois> test for table(...<batches>) 41b496fc0 <Romain Francois> table(...) cab now either handle ... being: c00774a0f <Romain Francois> table() factory also handles ... and !!! a schema, similar to record_batch() c5ad62643 <Romain Francois> retire RecordBatch__from_dataframe() function, no longer needed and replaced by RecordBatch__from_arrays() 20c5ce671 <Romain Francois> move the logic of `RecordBatch__from_arrays` internally. c71d87282 <Romain Francois> update docs d49906af4 <Romain Francois> Change record_batch() api so that it takes ... and schema. cd03e19ec <Romain Francois> + list_to_shared_ptr_vector 9a0f996e9 <Romain Francois> schema() supports tidy dots splicing, using rlang::list2