Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions r/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Meta
doc
inst/doc
*.o
*.o-*
*.d
Expand Down
3 changes: 3 additions & 0 deletions r/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ Collate:
'memory_pool.R'
'message.R'
'on_exit.R'
'read_record_batch.R'
'read_table.R'
'reexports-bit64.R'
'reexports-tibble.R'
'write_arrow.R'
'zzz.R'
85 changes: 37 additions & 48 deletions r/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,98 +6,95 @@ S3method("==","arrow::DataType")
S3method("==","arrow::Field")
S3method("==","arrow::RecordBatch")
S3method("==","arrow::ipc::Message")
S3method(BufferReader,"arrow::Buffer")
S3method(BufferReader,default)
S3method(FixedSizeBufferWriter,"arrow::Buffer")
S3method(FixedSizeBufferWriter,default)
S3method(MessageReader,"arrow::io::InputStream")
S3method(MessageReader,default)
S3method(RecordBatchFileReader,"arrow::io::RandomAccessFile")
S3method(RecordBatchFileReader,character)
S3method(RecordBatchFileReader,fs_path)
S3method(RecordBatchFileWriter,"arrow::io::OutputStream")
S3method(RecordBatchFileWriter,character)
S3method(RecordBatchFileWriter,fs_path)
S3method(RecordBatchStreamReader,"arrow::io::InputStream")
S3method(RecordBatchStreamReader,raw)
S3method(RecordBatchStreamWriter,"arrow::io::OutputStream")
S3method(RecordBatchStreamWriter,character)
S3method(RecordBatchStreamWriter,fs_path)
S3method(as_tibble,"arrow::RecordBatch")
S3method(as_tibble,"arrow::Table")
S3method(buffer,complex)
S3method(buffer,default)
S3method(buffer,integer)
S3method(buffer,numeric)
S3method(buffer,raw)
S3method(buffer_reader,"arrow::Buffer")
S3method(buffer_reader,default)
S3method(feather_table_reader,"arrow::io::RandomAccessFile")
S3method(feather_table_reader,"arrow::ipc::feather::TableReader")
S3method(feather_table_reader,character)
S3method(feather_table_reader,default)
S3method(feather_table_reader,fs_path)
S3method(feather_table_writer,"arrow::io::OutputStream")
S3method(fixed_size_buffer_writer,"arrow::Buffer")
S3method(fixed_size_buffer_writer,default)
S3method(length,"arrow::Array")
S3method(message_reader,"arrow::io::InputStream")
S3method(message_reader,default)
S3method(message_reader,raw)
S3method(names,"arrow::RecordBatch")
S3method(print,"arrow-enum")
S3method(read_message,"arrow::io::InputStream")
S3method(read_message,default)
S3method(read_record_batch,"arrow::io::BufferReader")
S3method(read_record_batch,"arrow::io::RandomAccessFile")
S3method(read_message,"arrow::ipc::MessageReader")
S3method(read_record_batch,"arrow::Buffer")
S3method(read_record_batch,"arrow::io::InputStream")
S3method(read_record_batch,"arrow::ipc::Message")
S3method(read_record_batch,"arrow::ipc::RecordBatchFileReader")
S3method(read_record_batch,"arrow::ipc::RecordBatchStreamReader")
S3method(read_record_batch,character)
S3method(read_record_batch,fs_path)
S3method(read_record_batch,raw)
S3method(read_schema,"arrow::Buffer")
S3method(read_schema,"arrow::io::InputStream")
S3method(read_schema,default)
S3method(read_schema,raw)
S3method(read_table,"arrow::io::BufferReader")
S3method(read_table,"arrow::io::RandomAccessFile")
S3method(read_table,"arrow::ipc::RecordBatchFileReader")
S3method(read_table,"arrow::ipc::RecordBatchStreamReader")
S3method(read_table,character)
S3method(read_table,fs_path)
S3method(read_table,raw)
S3method(record_batch_file_reader,"arrow::io::RandomAccessFile")
S3method(record_batch_file_reader,character)
S3method(record_batch_file_reader,fs_path)
S3method(record_batch_stream_reader,"arrow::io::InputStream")
S3method(record_batch_stream_reader,raw)
S3method(write_arrow,"arrow::RecordBatch")
S3method(write_arrow,"arrow::Table")
S3method(write_arrow,data.frame)
S3method(write_arrow,"arrow::ipc::RecordBatchWriter")
S3method(write_arrow,character)
S3method(write_arrow,fs_path)
S3method(write_arrow,raw)
S3method(write_feather,"arrow::RecordBatch")
S3method(write_feather,data.frame)
S3method(write_feather,default)
S3method(write_feather_RecordBatch,"arrow::io::OutputStream")
S3method(write_feather_RecordBatch,character)
S3method(write_feather_RecordBatch,default)
S3method(write_feather_RecordBatch,fs_path)
S3method(write_record_batch,"arrow::io::OutputStream")
S3method(write_record_batch,"arrow::ipc::RecordBatchWriter")
S3method(write_record_batch,character)
S3method(write_record_batch,fs_path)
S3method(write_record_batch,raw)
S3method(write_table,"arrow::io::OutputStream")
S3method(write_table,"arrow::ipc::RecordBatchWriter")
S3method(write_table,character)
S3method(write_table,fs_path)
S3method(write_table,raw)
export(BufferOutputStream)
export(BufferReader)
export(DateUnit)
export(FileMode)
export(FileOutputStream)
export(FixedSizeBufferWriter)
export(MessageReader)
export(MessageType)
export(MockOutputStream)
export(ReadableFile)
export(RecordBatchFileReader)
export(RecordBatchFileWriter)
export(RecordBatchStreamReader)
export(RecordBatchStreamWriter)
export(StatusCode)
export(TimeUnit)
export(Type)
export(array)
export(as_tibble)
export(boolean)
export(buffer)
export(buffer_output_stream)
export(buffer_reader)
export(cast_options)
export(chunked_array)
export(date32)
export(date64)
export(decimal)
export(default_memory_pool)
export(dictionary)
export(feather_table_reader)
export(feather_table_writer)
export(field)
export(file_open)
export(file_output_stream)
export(fixed_size_buffer_writer)
export(float16)
export(float32)
export(float64)
Expand All @@ -106,10 +103,8 @@ export(int32)
export(int64)
export(int8)
export(list_of)
export(message_reader)
export(mmap_create)
export(mmap_open)
export(mock_output_stream)
export(null)
export(print.integer64)
export(read_arrow)
Expand All @@ -119,10 +114,6 @@ export(read_record_batch)
export(read_schema)
export(read_table)
export(record_batch)
export(record_batch_file_reader)
export(record_batch_file_writer)
export(record_batch_stream_reader)
export(record_batch_stream_writer)
export(schema)
export(str.integer64)
export(struct)
Expand All @@ -138,8 +129,6 @@ export(utf8)
export(write_arrow)
export(write_feather)
export(write_feather_RecordBatch)
export(write_record_batch)
export(write_table)
importFrom(R6,R6Class)
importFrom(Rcpp,sourceCpp)
importFrom(assertthat,assert_that)
Expand Down
24 changes: 24 additions & 0 deletions r/R/ArrayData.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,30 @@

#' @include R6.R

#' @title class arrow::ArrayData
#'
#' @usage NULL
#' @format NULL
#' @docType class
#'
#' @section Usage:
#'
#' ```
#' data <- array(...)$data()
#'
#' data$type()
#' data$length()
#' data$null_count()
#' data$offset()
#' data$buffers()
#' ```
#'
#' @section Methods:
#'
#' ...
#'
#' @rdname arrow__ArrayData
#' @name arrow__ArrayData
`arrow::ArrayData` <- R6Class("arrow::ArrayData",
inherit = `arrow::Object`,
active = list(
Expand Down
24 changes: 19 additions & 5 deletions r/R/ChunkedArray.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,22 @@

#' @include R6.R

#' @title class arrow::ChunkedArray
#'
#' @usage NULL
#' @format NULL
#' @docType class
#'
#' @section Methods:
#'
#' TODO
#'
#' @rdname arrow__ChunkedArray
#' @name arrow__ChunkedArray
`arrow::ChunkedArray` <- R6Class("arrow::ChunkedArray", inherit = `arrow::Object`,
public = list(
length = function() ChunkedArray__length(self),
null_count = function() ChunkedArray__null_count(self),
num_chunks = function() ChunkedArray__num_chunks(self),
chunk = function(i) shared_ptr(`arrow::Array`, ChunkedArray__chunk(self, i)),
chunks = function() purrr::map(ChunkedArray__chunks(self), shared_ptr, class = `arrow::Array`),
type = function() `arrow::DataType`$dispatch(ChunkedArray__type(self)),
as_vector = function() ChunkedArray__as_vector(self),
Slice = function(offset, length = NULL){
if (is.null(length)) {
Expand All @@ -38,10 +46,16 @@
assert_that(inherits(options, "arrow::compute::CastOptions"))
shared_ptr(`arrow::ChunkedArray`, ChunkedArray__cast(self, target_type, options))
}
),
active = list(
null_count = function() ChunkedArray__null_count(self),
num_chunks = function() ChunkedArray__num_chunks(self),
chunks = function() map(ChunkedArray__chunks(self), shared_ptr, class = `arrow::Array`),
type = function() `arrow::DataType`$dispatch(ChunkedArray__type(self))
)
)

#' create an arrow::Array from an R vector
#' create an [arrow::ChunkedArray][arrow__ChunkedArray] from various R vectors
#'
#' @param \dots Vectors to coerce
#' @param type currently ignored
Expand Down
19 changes: 17 additions & 2 deletions r/R/Column.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,26 @@

#' @include R6.R

#' @title class arrow::Column
#'
#' @usage NULL
#' @format NULL
#' @docType class
#'
#' @section Methods:
#'
#' TODO
#'
#' @rdname arrow__Column
#' @name arrow__Column
`arrow::Column` <- R6Class("arrow::Column", inherit = `arrow::Object`,
public = list(
length = function() Column__length(self),
null_count = function() Column__null_count(self),
type = function() `arrow::DataType`$dispatch(Column__type(self)),
data = function() shared_ptr(`arrow::ChunkedArray`, Column__data(self))
),

active = list(
null_count = function() Column__null_count(self),
type = function() `arrow::DataType`$dispatch(Column__type(self))
)
)
21 changes: 18 additions & 3 deletions r/R/Field.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,35 @@

#' @include R6.R

#' @title class arrow::Field
#'
#' @usage NULL
#' @format NULL
#' @docType class
#'
#' @section Methods:
#'
#' TODO
#'
#' @rdname arrow__Field
#' @name arrow__Field
`arrow::Field` <- R6Class("arrow::Field", inherit = `arrow::Object`,
public = list(
ToString = function() {
Field__ToString(self)
},
Equals = function(other) {
inherits(other, "arrow::Field") && Field__Equals(self, other)
}
),

active = list(
name = function() {
Field__name(self)
},
nullable = function() {
Field__nullable(self)
},
Equals = function(other) {
inherits(other, "arrow::Field") && Field__Equals(self, other)
},
type = function() {
`arrow::DataType`$dispatch(Field__type(self))
}
Expand Down
Loading