Title: | Modern Database Engine for Complex Data Based on Multi-Dimensional Arrays |
---|---|
Description: | The modern database 'TileDB' introduces a powerful on-disk format for storing and accessing any complex data based on multi-dimensional arrays. It supports dense and sparse arrays, dataframes and key-values stores, cloud storage ('S3', 'GCS', 'Azure'), chunked arrays, multiple compression, encryption and checksum filters, uses a fully multi-threaded implementation, supports parallel I/O, data versioning ('time travel'), metadata and groups. It is implemented as an embeddable cross-platform C++ library with APIs from several languages, and integrations. This package provides the R support. |
Authors: | TileDB, Inc. [aut, cph], Dirk Eddelbuettel [cre] |
Maintainer: | Dirk Eddelbuettel <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.26.0 |
Built: | 2024-12-07 05:56:47 UTC |
Source: | https://github.com/TileDB-Inc/TileDB-R |
Heterogenous domains are supported, including timestamps and characters.
## S4 method for signature 'tiledb_array,ANY' x[i, j, ..., drop = FALSE]
## S4 method for signature 'tiledb_array,ANY' x[i, j, ..., drop = FALSE]
x |
tiledb_array object |
i |
optional row index expression which can be a list in which case minimum and maximum of each list element determine a range; multiple list elements can be used to supply multiple ranges. |
j |
optional column index expression which can be a list in which case minimum and maximum of each list element determine a range; multiple list elements can be used to supply multiple ranges. |
... |
Extra parameters for method signature, currently unused. |
drop |
Optional logical switch to drop dimensions, default FALSE, currently unused. |
This function may still still change; the current implementation should be considered as an initial draft.
The resulting elements in the selected format
Gets a config parameter value
## S4 method for signature 'tiledb_config,ANY' x[i, j, ..., drop = FALSE]
## S4 method for signature 'tiledb_config,ANY' x[i, j, ..., drop = FALSE]
x |
|
i |
parameter key string |
j |
parameter key string, currently unused. |
... |
Extra parameter for method signature, currently unused. |
drop |
Optional logical switch to drop dimensions, default FALSE, currently unused. |
a config string value if parameter exists, else NA
cfg <- tiledb_config() cfg["sm.tile_cache_size"] cfg["does_not_exist"]
cfg <- tiledb_config() cfg["sm.tile_cache_size"] cfg["does_not_exist"]
Returns the filter at given index
## S4 method for signature 'tiledb_filter_list,ANY' x[i, j, ..., drop = FALSE]
## S4 method for signature 'tiledb_filter_list,ANY' x[i, j, ..., drop = FALSE]
x |
|
i |
parameter key string |
j |
parameter key string, currently unused. |
... |
Extra parameter for method signature, currently unused. |
drop |
Optional logical switch to drop dimensions, default false. |
object tiledb_filter
flt <- tiledb_filter("ZSTD") tiledb_filter_set_option(flt, "COMPRESSION_LEVEL", 5) filter_list <- tiledb_filter_list(c(flt)) filter_list[0]
flt <- tiledb_filter("ZSTD") tiledb_filter_set_option(flt, "COMPRESSION_LEVEL", 5) filter_list <- tiledb_filter_list(c(flt)) filter_list[0]
This function assigns a right-hand side object, typically a data.frame or something that can be coerced to a data.frame, to a tiledb array.
## S4 replacement method for signature 'tiledb_array,ANY,ANY,ANY' x[i, j, ...] <- value
## S4 replacement method for signature 'tiledb_array,ANY,ANY,ANY' x[i, j, ...] <- value
x |
sparse or dense TileDB array object |
i |
parameter row index |
j |
parameter column index |
... |
Extra parameter for method signature, currently unused. |
value |
The value being assigned |
For sparse matrices, row and column indices can either be supplied as part of the left-hand side object, or as part of the data.frame provided approrpiate column names.
This function may still still change; the current implementation should be considered as an initial draft.
The modified object
## Not run: uri <- "quickstart_sparse" ## as created by the other example arr <- tiledb_array(uri) ## open array df <- arr[] ## read current content ## First approach: matching data.frame with appriate row and column newdf <- data.frame(rows=c(1,2,2), cols=c(1,3,4), a=df$a+100) ## Second approach: supply indices explicitly arr[c(1,2), c(1,3)] <- c(42,43) ## two values arr[2, 4] <- 88 ## or just one ## End(Not run)
## Not run: uri <- "quickstart_sparse" ## as created by the other example arr <- tiledb_array(uri) ## open array df <- arr[] ## read current content ## First approach: matching data.frame with appriate row and column newdf <- data.frame(rows=c(1,2,2), cols=c(1,3,4), a=df$a+100) ## Second approach: supply indices explicitly arr[c(1,2), c(1,3)] <- c(42,43) ## two values arr[2, 4] <- 88 ## or just one ## End(Not run)
Sets a config parameter value
## S4 replacement method for signature 'tiledb_config,ANY,ANY,ANY' x[i, j] <- value
## S4 replacement method for signature 'tiledb_config,ANY,ANY,ANY' x[i, j] <- value
x |
|
i |
parameter key string |
j |
parameter key string |
value |
value to set, will be converted into a stringa |
updated tiledb_config
object
cfg <- tiledb_config() cfg["sm.tile_cache_size"] # set tile cache size to custom value cfg["sm.tile_cache_size"] <- 100 cfg["sm.tile_cache_size"]
cfg <- tiledb_config() cfg["sm.tile_cache_size"] # set tile cache size to custom value cfg["sm.tile_cache_size"] <- 100 cfg["sm.tile_cache_size"]
Returns logical value whether the array schema allows duplicate values or not. This is only valid for sparse arrays.
allows_dups(x) ## S4 method for signature 'tiledb_array_schema' allows_dups(x) tiledb_array_schema_get_allows_dups(x)
allows_dups(x) ## S4 method for signature 'tiledb_array_schema' allows_dups(x) tiledb_array_schema_get_allows_dups(x)
x |
tiledb_array_schema |
the logical value
Sets toggle whether the array schema allows duplicate values or not. This is only valid for sparse arrays.
allows_dups(x) <- value ## S4 replacement method for signature 'tiledb_array_schema' allows_dups(x) <- value tiledb_array_schema_set_allows_dups(x, value)
allows_dups(x) <- value ## S4 replacement method for signature 'tiledb_array_schema' allows_dups(x) <- value tiledb_array_schema_set_allows_dups(x, value)
x |
tiledb_array_schema |
value |
logical value |
the tiledb_array_schema object
This function invokes a consolidation operation. Parameters affecting the operation can be set via an optional configuration object. Start and end timestamps can also be set directly.
array_consolidate( uri, cfg = NULL, start_time, end_time, ctx = tiledb_get_context() )
array_consolidate( uri, cfg = NULL, start_time, end_time, ctx = tiledb_get_context() )
uri |
A character value with the URI of a TileDB Array |
cfg |
An optional TileDB Configuration object |
start_time |
An optional timestamp value, if missing config default is used |
end_time |
An optional timestamp value, if missing config default is used |
ctx |
An option TileDB Context object |
NULL is returned invisibly
This function can remove fragments following a consolidation step. Note that vacuuming should not be run if one intends to use the TileDB time-traveling feature of opening arrays at particular timestamps.
array_vacuum(uri, cfg = NULL, start_time, end_time, ctx = tiledb_get_context())
array_vacuum(uri, cfg = NULL, start_time, end_time, ctx = tiledb_get_context())
uri |
A character value with the URI of a TileDB Array |
cfg |
An optional TileDB Configuration object |
start_time |
An optional timestamp value, if missing config default is used |
end_time |
An optional timestamp value, if missing config default is used |
ctx |
An option TileDB Context object |
Parameters affecting the operation can be set via an optional configuration object. Start and end timestamps can also be set directly.
NULL is returned invisibly
tiledb_config
object to a R data.frameConvert a tiledb_config
object to a R data.frame
## S3 method for class 'tiledb_config' as.data.frame(x, ...)
## S3 method for class 'tiledb_config' as.data.frame(x, ...)
x |
|
... |
Extra parameter for method signature, currently unused. |
a data.frame wth parameter, value columns
cfg <- tiledb_config() as.data.frame(cfg)
cfg <- tiledb_config() as.data.frame(cfg)
tiledb_config
object to a R vectorConvert a tiledb_config
object to a R vector
## S3 method for class 'tiledb_config' as.vector(x, mode = "any")
## S3 method for class 'tiledb_config' as.vector(x, mode = "any")
x |
|
mode |
Character value |
a character vector of config parameter names, values
cfg <- tiledb_config() as.vector(cfg)
cfg <- tiledb_config() as.vector(cfg)
tiledb_attr
objects associated with the tiledb_array_schema
Returns a list of all tiledb_attr
objects associated with the tiledb_array_schema
## S4 method for signature 'tiledb_array_schema,ANY' attrs(object, idx, ...)
## S4 method for signature 'tiledb_array_schema,ANY' attrs(object, idx, ...)
object |
tiledb_array_schema |
idx |
index argument, currently unused. |
... |
Extra parameter for method signature, currently unused. |
a list of tiledb_attr objects
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"), tiledb_attr("a2", type = "FLOAT64"))) attrs(sch) lapply(attrs(sch), datatype)
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"), tiledb_attr("a2", type = "FLOAT64"))) attrs(sch) lapply(attrs(sch), datatype)
tiledb_attr
object associated with the tiledb_array_schema
with a given name.Returns a tiledb_attr
object associated with the tiledb_array_schema
with a given name.
## S4 method for signature 'tiledb_array_schema,character' attrs(object, idx, ...)
## S4 method for signature 'tiledb_array_schema,character' attrs(object, idx, ...)
object |
tiledb_array_schema |
idx |
attribute name string |
... |
Extra parameter for method signature, currently unused. |
a tiledb_attr
object
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"), tiledb_attr("a2", type = "FLOAT64"))) attrs(sch, "a2")
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"), tiledb_attr("a2", type = "FLOAT64"))) attrs(sch, "a2")
tiledb_attr
object associated with the tiledb_array_schema
with a given indexThe attribute index is defined by the order the attributes were defined in the schema
## S4 method for signature 'tiledb_array_schema,numeric' attrs(object, idx, ...)
## S4 method for signature 'tiledb_array_schema,numeric' attrs(object, idx, ...)
object |
tiledb_array_schema |
idx |
attribute index |
... |
Extra parameter for method signature, currently unused. |
a tiledb_attr
object
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"), tiledb_attr("a2", type = "FLOAT64"))) attrs(sch, 2)
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"), tiledb_attr("a2", type = "FLOAT64"))) attrs(sch, 2)
tiledb_array
objectBy default, all attributes will be selected. But if a subset of attribute
names is assigned to the internal slot attrs
, then only those attributes
will be queried. This methods accesses the slot.
## S4 method for signature 'tiledb_array,ANY' attrs(object)
## S4 method for signature 'tiledb_array,ANY' attrs(object)
object |
A |
An empty character vector if no attributes have been selected or else
a vector with attributes; NA
means no attributes will be returned.
Selects attributes for the given TileDB array
## S4 replacement method for signature 'tiledb_array' attrs(x) <- value
## S4 replacement method for signature 'tiledb_array' attrs(x) <- value
x |
A |
value |
A character vector with attributes; the value |
The modified tiledb_array
object
Returns the tiledb_array
schema tile capacity for sparse fragments.
capacity(object) ## S4 method for signature 'tiledb_array_schema' capacity(object) tiledb_array_schema_get_capacity(object)
capacity(object) ## S4 method for signature 'tiledb_array_schema' capacity(object) tiledb_array_schema_get_capacity(object)
object |
An |
The tile capacity value
Sets the tiledb_array
schema tile capacity for sparse fragments.
capacity(x) <- value ## S4 replacement method for signature 'tiledb_array_schema' capacity(x) <- value tiledb_array_schema_set_capacity(x, value)
capacity(x) <- value ## S4 replacement method for signature 'tiledb_array_schema' capacity(x) <- value tiledb_array_schema_set_capacity(x, value)
x |
An |
value |
An integer or numeric value for the new tile capacity |
The modified array_schema
object
tiledb_array_schema
Returns the cell layout string associated with the tiledb_array_schema
## S4 method for signature 'tiledb_array_schema' cell_order(object)
## S4 method for signature 'tiledb_array_schema' cell_order(object)
object |
tiledb object |
Return the number of scalar values per attribute cell
cell_val_num(object) ## S4 method for signature 'tiledb_attr' cell_val_num(object) tiledb_attribute_get_cell_val_num(object)
cell_val_num(object) ## S4 method for signature 'tiledb_attr' cell_val_num(object) tiledb_attribute_get_cell_val_num(object)
object |
|
integer number of cells
a1 <- tiledb_attr("a1", type = "FLOAT64", ncells = 1) cell_val_num(a1)
a1 <- tiledb_attr("a1", type = "FLOAT64", ncells = 1) cell_val_num(a1)
Return the number of scalar values per dimension cell
## S4 method for signature 'tiledb_dim' cell_val_num(object) tiledb_dim_get_cell_val_num(object)
## S4 method for signature 'tiledb_dim' cell_val_num(object) tiledb_dim_get_cell_val_num(object)
object |
|
integer number of cells
Set the number of scalar values per attribute cell
cell_val_num(x) <- value ## S4 replacement method for signature 'tiledb_attr' cell_val_num(x) <- value tiledb_attribute_set_cell_val_num(x, value)
cell_val_num(x) <- value ## S4 replacement method for signature 'tiledb_attr' cell_val_num(x) <- value tiledb_attribute_set_cell_val_num(x, value)
x |
A TileDB Attribute object |
value |
An integer value of number of cells |
The modified attribute is returned
Batched queries return an initial result set even when it is incomplete. Where the normal retrieval process will loop in place to complete a (potentially large) result set, this function will return a result (which may be part of a larger result set) allowing the user to assemble all part.
completedBatched(obj)
completedBatched(obj)
obj |
A list object as returned by |
A logical value to indicated if the query completed
tiledb_config
object from the tiledb_ctx
Retrieve the tiledb_config
object from the tiledb_ctx
## S4 method for signature 'tiledb_ctx' config(object = tiledb_get_context())
## S4 method for signature 'tiledb_ctx' config(object = tiledb_get_context())
object |
tiledb_ctx object |
tiledb_config
object associated with the tiledb_ctx
instance
ctx <- tiledb_ctx(c("sm.tile_cache_size" = "10")) cfg <- config(ctx) cfg["sm.tile_cache_size"]
ctx <- tiledb_ctx(c("sm.tile_cache_size" = "10")) cfg <- config(ctx) cfg["sm.tile_cache_size"]
Batched queries return an initial result set even when it is incomplete. Where the normal retrieval process will loop in place to complete a (potentially large) result set, this function will return a result (which may be part of a larger result set) allowing the user to assemble all part.
createBatched(x)
createBatched(x)
x |
A |
The tiledb_array
object can be parameterised as usual.
A batchedquery
object, that is a list containing an external pointer
to a TileDB Query object along with other support variables used by fetchBatched
tiledb_attr
datatypeReturn the tiledb_attr
datatype
## S4 method for signature 'tiledb_attr' datatype(object)
## S4 method for signature 'tiledb_attr' datatype(object)
object |
|
tiledb datatype string
a1 <- tiledb_attr("a1", type = "INT32") datatype(a1) a2 <- tiledb_attr("a1", type = "FLOAT64") datatype(a2)
a1 <- tiledb_attr("a1", type = "INT32") datatype(a1) a2 <- tiledb_attr("a1", type = "FLOAT64") datatype(a2)
tiledb_dim
datatypeReturn the tiledb_dim
datatype
## S4 method for signature 'tiledb_dim' datatype(object)
## S4 method for signature 'tiledb_dim' datatype(object)
object |
tiledb_dim object |
tiledb datatype string
d1 <- tiledb_dim("d1", domain = c(5L, 10L), tile = 2L, type = "INT32") datatype(d1)
d1 <- tiledb_dim("d1", domain = c(5L, 10L), tile = 2L, type = "INT32") datatype(d1)
Returns the tiledb_domain TileDB type string
## S4 method for signature 'tiledb_domain' datatype(object)
## S4 method for signature 'tiledb_domain' datatype(object)
object |
tiledb_domain |
tiledb_domain type string
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 100L), type = "INT32"))) datatype(dom) dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(0.5, 100.0), type = "FLOAT64"))) datatype(dom)
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 100L), type = "INT32"))) datatype(dom) dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(0.5, 100.0), type = "FLOAT64"))) datatype(dom)
A tiledb_array
object may contain date and datetime objects. While their internal
representation is generally shielded from the user, it can useful to access them as the
‘native’ format which is an integer64
. This function retrieves the current
value of the selection variable, which has a default of FALSE
.
datetimes_as_int64(object) ## S4 method for signature 'tiledb_array' datetimes_as_int64(object)
datetimes_as_int64(object) ## S4 method for signature 'tiledb_array' datetimes_as_int64(object)
object |
A |
A logical value indicating whether datetimes_as_int64
is selected
A tiledb_array
object may contain date and datetime objects. While their internal
representation is generally shielded from the user, it can useful to access them as the
‘native’ format which is an integer64
. This function set the current
value of the selection variable, which has a default of FALSE
.
datetimes_as_int64(x) <- value ## S4 replacement method for signature 'tiledb_array' datetimes_as_int64(x) <- value
datetimes_as_int64(x) <- value ## S4 replacement method for signature 'tiledb_array' datetimes_as_int64(x) <- value
x |
A |
value |
A logical value with the selection |
The modified tiledb_array
array object
Describe a TileDB array schema via code to create it
describe(arr)
describe(arr)
arr |
A TileDB Array object |
Nothing is returned as the function is invoked for the side effect of printing the schema via a sequence of R instructions to re-create it.
Only valid for integral (integer) domains
## S3 method for class 'tiledb_array_schema' dim(x)
## S3 method for class 'tiledb_array_schema' dim(x)
x |
tiledb_array_schema |
a dimension vector
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"), tiledb_attr("a2", type = "FLOAT64"))) dim(sch)
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"), tiledb_attr("a2", type = "FLOAT64"))) dim(sch)
Retrieves the dimension of the tiledb_dim domain
## S3 method for class 'tiledb_dim' dim(x)
## S3 method for class 'tiledb_dim' dim(x)
x |
|
a vector of the tile_dim domain type, of the dim domain dimension (extent)
d1 <- tiledb_dim("d1", c(1L, 10L), 5L) dim(d1)
d1 <- tiledb_dim("d1", c(1L, 10L), 5L) dim(d1)
Only valid for integral (integer) domains
## S3 method for class 'tiledb_domain' dim(x)
## S3 method for class 'tiledb_domain' dim(x)
x |
tiledb_domain |
dimension vector
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 100L), type = "INT32"), tiledb_dim("d2", c(1L, 100L), type = "INT32"))) dim(dom)
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 100L), type = "INT32"), tiledb_dim("d2", c(1L, 100L), type = "INT32"))) dim(dom)
tiledb_dim
objects associated with the tiledb_array_schema
Returns a list of tiledb_dim
objects associated with the tiledb_array_schema
## S4 method for signature 'tiledb_array_schema' dimensions(object)
## S4 method for signature 'tiledb_array_schema' dimensions(object)
object |
tiledb_array_schema |
a list of tiledb_dim objects
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 100L), type = "INT32"), tiledb_dim("d2", c(1L, 50L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"))) dimensions(dom) lapply(dimensions(dom), name)
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 100L), type = "INT32"), tiledb_dim("d2", c(1L, 50L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"))) dimensions(dom) lapply(dimensions(dom), name)
Returns a list of the tiledb_domain dimension objects
## S4 method for signature 'tiledb_domain' dimensions(object)
## S4 method for signature 'tiledb_domain' dimensions(object)
object |
tiledb_domain |
a list of tiledb_dim
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 100L), type = "INT32"), tiledb_dim("d2", c(1L, 50L), type = "INT32"))) dimensions(dom) lapply(dimensions(dom), name)
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 100L), type = "INT32"), tiledb_dim("d2", c(1L, 50L), type = "INT32"))) dimensions(dom) lapply(dimensions(dom), name)
tiledb_domain
object associated with a given tiledb_array_schema
Returns the tiledb_domain
object associated with a given tiledb_array_schema
## S4 method for signature 'tiledb_array_schema' domain(object)
## S4 method for signature 'tiledb_array_schema' domain(object)
object |
tiledb_array_schema |
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"))) domain(sch)
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"))) domain(sch)
tiledb_dim
domainReturn the tiledb_dim
domain
## S4 method for signature 'tiledb_dim' domain(object)
## S4 method for signature 'tiledb_dim' domain(object)
object |
|
a vector of (lb, ub) inclusive domain of the dimension
d1 <- tiledb_dim("d1", domain = c(5L, 10L)) domain(d1)
d1 <- tiledb_dim("d1", domain = c(5L, 10L)) domain(d1)
A tiledb_array
object can be returned as data.frame
. This methods
returns the selection value for ‘extended’ format including row (and column,
if present) indices.
extended(object) ## S4 method for signature 'tiledb_array' extended(object)
extended(object) ## S4 method for signature 'tiledb_array' extended(object)
object |
A |
A logical value indicating whether an extended
return is selected
A tiledb_array
object can be returned as data.frame
. This methods
set the selection value for ‘extended’ format including row (and column,
if present) indices.
extended(x) <- value ## S4 replacement method for signature 'tiledb_array' extended(x) <- value
extended(x) <- value ## S4 replacement method for signature 'tiledb_array' extended(x) <- value
x |
A |
value |
A logical value with the selection |
The modified tiledb_array
array object
Batched queries return an initial result set even when it is incomplete. Where the normal retrieval process will loop in place to complete a (potentially large) result set, this function will return a result (which may be part of a larger result set) allowing the user to assemble all part.
fetchBatched(x, obj)
fetchBatched(x, obj)
x |
A |
obj |
A |
The tiledb_array
object can be parameterised as usual.
A data.frame object with the (potentially partial) result of a batched query
tiledb_array_schema
Returns the offsets and coordinate filter_lists associated with the tiledb_array_schema
## S4 method for signature 'tiledb_array_schema' filter_list(object)
## S4 method for signature 'tiledb_array_schema' filter_list(object)
object |
tiledb_array_schema |
a list of tiledb_filter_list objects
Returns the TileDB Filter List object associated with the given TileDB Attribute
## S4 method for signature 'tiledb_attr' filter_list(object)
## S4 method for signature 'tiledb_attr' filter_list(object)
object |
TileDB Attribute |
a tiledb_filter_list object
attr <- tiledb_attr(type = "INT32", filter_list=tiledb_filter_list(list(tiledb_filter("ZSTD")))) filter_list(attr)
attr <- tiledb_attr(type = "INT32", filter_list=tiledb_filter_list(list(tiledb_filter("ZSTD")))) filter_list(attr)
Returns the TileDB Filter List object associated with the given TileDB Dimension
## S4 method for signature 'tiledb_dim' filter_list(object)
## S4 method for signature 'tiledb_dim' filter_list(object)
object |
TileDB_Dimension |
A TileDB_filter_list object
Sets the TileDB Filter List for the TileDB Attribute object
## S4 replacement method for signature 'tiledb_attr' filter_list(x) <- value
## S4 replacement method for signature 'tiledb_attr' filter_list(x) <- value
x |
TileDB Attribute |
value |
TileDB Filter List |
The modified TileDB Attribute object
Sets the TileDB Filter List for the TileDB Dimension object
## S4 replacement method for signature 'tiledb_dim' filter_list(x) <- value
## S4 replacement method for signature 'tiledb_dim' filter_list(x) <- value
x |
TileDB Dimension |
value |
TileDB Filter List |
The modified TileDB Dimension object
data.frame
ObjectThe supplied data.frame
object is (currently) limited to integer,
numeric, or character. In addition, three datetime columns are supported
with the R representations of Date
, POSIXct
and nanotime
.
fromDataFrame( obj, uri, col_index = NULL, sparse = TRUE, allows_dups = sparse, cell_order = "COL_MAJOR", tile_order = "COL_MAJOR", filter = "ZSTD", capacity = 10000L, tile_domain = NULL, tile_extent = NULL, mode = c("ingest", "schema_only", "append"), filter_list = NULL, coords_filters = "ZSTD", offsets_filters = "ZSTD", validity_filters = "RLE", debug = FALSE )
fromDataFrame( obj, uri, col_index = NULL, sparse = TRUE, allows_dups = sparse, cell_order = "COL_MAJOR", tile_order = "COL_MAJOR", filter = "ZSTD", capacity = 10000L, tile_domain = NULL, tile_extent = NULL, mode = c("ingest", "schema_only", "append"), filter_list = NULL, coords_filters = "ZSTD", offsets_filters = "ZSTD", validity_filters = "RLE", debug = FALSE )
obj |
A |
uri |
A character variable with an Array URI. |
col_index |
An optional column index, either numeric with a column index, or character with a column name, designating an index column; default is NULL implying an index column is added when the array is created |
sparse |
A logical switch to select sparse (the default) or dense |
allows_dups |
A logical switch to select if duplicate values are allowed or not, default is the same value as ‘sparse’. |
cell_order |
A character variable with one of the TileDB cell order values, default is “COL_MAJOR”. |
tile_order |
A character variable with one of the TileDB tile order values, default is “COL_MAJOR”. |
filter |
A character variable vector, defaults to ‘ZSTD’, for one or more filters to be applied to each attribute; |
capacity |
A integer value with the schema capacity, default is 10000. |
tile_domain |
An integer vector or list or |
tile_extent |
An integer value for the tile extent of the row dimensions;
if |
mode |
A character variable with possible values ‘ingest’ (for schema creation and data ingestion, the default behavior), ‘schema_only’ (to create the array schema without writing to the newly-created array) and ‘append’ (to only append to an already existing array). |
filter_list |
A named list specifying filter choices per column, default is an empty
|
coords_filters |
A character vector with filters for coordinates, default is |
offsets_filters |
A character vector with filters for coordinates, default is |
validity_filters |
A character vector with filters for coordinates, default is |
debug |
Logical flag to select additional output. |
The created (dense or sparse) array will have as many attributes as there
are columns in the data.frame
. Each attribute will be a single column.
For a sparse array, one or more columns have to be designated as dimensions.
At present, factor variable are converted to character.
Null, invisibly.
uri <- tempfile() fromDataFrame(iris, uri) arr <- tiledb_array(uri, return_as="data.frame", extended=FALSE) newdf <- arr[] all.equal(iris, newdf, check.attributes=FALSE) # extra attribute on query in newdf all.equal(as.matrix(iris), as.matrix(newdf)) # also strips attribute
uri <- tempfile() fromDataFrame(iris, uri) arr <- tiledb_array(uri, return_as="data.frame", extended=FALSE) newdf <- arr[] all.equal(iris, newdf, check.attributes=FALSE) # extra attribute on query in newdf all.equal(as.matrix(iris), as.matrix(newdf)) # also strips attribute
The functions fromMatrix
and toMatrix
help in storing
(and retrieving) matrices using a TileDB backend. In particular they help
for matrices with explicit rownames.
fromMatrix(obj, uri, filter = "ZSTD", capacity = 10000L) toMatrix(uri)
fromMatrix(obj, uri, filter = "ZSTD", capacity = 10000L) toMatrix(uri)
obj |
A sparse matrix object. |
uri |
A character variable with an Array URI. |
filter |
A character variable vector, defaults to ‘ZSTD’, for one or more filters to be applied to each attribute; |
capacity |
A integer value with the schema capacity, default is 10000. |
Null, invisibly.
The functions fromSparseMatrix
and toSparseMatrix
help in storing
(and retrieving) sparse matrices using a TileDB backend.
fromSparseMatrix( obj, uri, cell_order = "ROW_MAJOR", tile_order = "ROW_MAJOR", filter = "ZSTD", capacity = 10000L ) toSparseMatrix(uri)
fromSparseMatrix( obj, uri, cell_order = "ROW_MAJOR", tile_order = "ROW_MAJOR", filter = "ZSTD", capacity = 10000L ) toSparseMatrix(uri)
obj |
A sparse matrix object. |
uri |
A character variable with an Array URI. |
cell_order |
A character variable with one of the TileDB cell order values, default is “COL_MAJOR”. |
tile_order |
A character variable with one of the TileDB tile order values, default is “COL_MAJOR”. |
filter |
A character variable vector, defaults to ‘ZSTD’, for one or more filters to be applied to each attribute; |
capacity |
A integer value with the schema capacity, default is 10000. |
Null, invisibly.
## Not run: if (requireNamespace("Matrix", quietly=TRUE)) { library(Matrix) set.seed(123) # just to fix it mat <- matrix(0, nrow=20, ncol=10) mat[sample(seq_len(200), 20)] <- seq(1, 20) spmat <- as(mat, "dgTMatrix") # sparse matrix in dgTMatrix format uri <- "sparse_matrix" fromSparseMatrix(spmat, uri) # now written chk <- toSparseMatrix(uri) # and re-read print(chk) all.equal(spmat, chk) } ## End(Not run)
## Not run: if (requireNamespace("Matrix", quietly=TRUE)) { library(Matrix) set.seed(123) # just to fix it mat <- matrix(0, nrow=20, ncol=10) mat[sample(seq_len(200), 20)] <- seq(1, 20) spmat <- as(mat, "dgTMatrix") # sparse matrix in dgTMatrix format uri <- "sparse_matrix" fromSparseMatrix(spmat, uri) # now written chk <- toSparseMatrix(uri) # and re-read print(chk) all.equal(spmat, chk) } ## End(Not run)
Definition of generic methods
schema(object, ...) return.data.frame(object, ...) return.data.frame(x) <- value attrs(x) <- value raw_dump(object, ...) domain(object, ...) dimensions(object, ...) attrs(object, idx, ...) cell_order(object, ...) tile_order(object, ...) filter_list(object, ...) filter_list(x) <- value is.sparse(object, ...) tiledb_ndim(object, ...) name(object) datatype(object) config(object, ...) tile(object) is.integral(object) nfilters(object) tdb_filter(x, ...) tdb_select(x, ...) tdb_collect(x, ...)
schema(object, ...) return.data.frame(object, ...) return.data.frame(x) <- value attrs(x) <- value raw_dump(object, ...) domain(object, ...) dimensions(object, ...) attrs(object, idx, ...) cell_order(object, ...) tile_order(object, ...) filter_list(object, ...) filter_list(x) <- value is.sparse(object, ...) tiledb_ndim(object, ...) name(object) datatype(object) config(object, ...) tile(object) is.integral(object) nfilters(object) tdb_filter(x, ...) tdb_select(x, ...) tdb_collect(x, ...)
object |
A TileDB object |
... |
Currently unused |
x |
A TileDB Object |
value |
A value to be assigned |
idx |
An index argument |
Check a schema for a given attribute name
has_attribute(schema, attr)
has_attribute(schema, attr)
schema |
A schema for a TileDB Array |
attr |
A character variable with an attribute name |
A boolean value indicating if the attribute exists in the schema
A TileDB attribute is anonymous if no name/label is defined
is.anonymous(object) ## S3 method for class 'tiledb_attr' is.anonymous(object)
is.anonymous(object) ## S3 method for class 'tiledb_attr' is.anonymous(object)
object |
|
TRUE or FALSE
a1 <- tiledb_attr("a1", type = "FLOAT64") is.anonymous(a1) a2 <- tiledb_attr("", type = "FLOAT64") is.anonymous(a2)
a1 <- tiledb_attr("a1", type = "FLOAT64") is.anonymous(a1) a2 <- tiledb_attr("", type = "FLOAT64") is.anonymous(a2)
A TileDB dimension is anonymous if no name/label is defined
## S3 method for class 'tiledb_dim' is.anonymous(object)
## S3 method for class 'tiledb_dim' is.anonymous(object)
object |
|
TRUE or FALSE
d1 <- tiledb_dim("d1", c(1L, 10L), 10L) is.anonymous(d1) d2 <- tiledb_dim("", c(1L, 10L), 10L) is.anonymous(d2)
d1 <- tiledb_dim("d1", c(1L, 10L), 10L) is.anonymous(d1) d2 <- tiledb_dim("", c(1L, 10L), 10L) is.anonymous(d2)
Returns TRUE is tiledb_domain is an integral (integer) domain
## S4 method for signature 'tiledb_domain' is.integral(object)
## S4 method for signature 'tiledb_domain' is.integral(object)
object |
tiledb_domain |
TRUE if the domain is an integral domain, else FALSE
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 100L), type = "INT32"))) is.integral(dom) dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(0.5, 100.0), type = "FLOAT64"))) is.integral(dom)
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 100L), type = "INT32"))) is.integral(dom) dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(0.5, 100.0), type = "FLOAT64"))) is.integral(dom)
Returns TRUE if the tiledb_array_schema is sparse, else FALSE
## S4 method for signature 'tiledb_array_schema' is.sparse(object)
## S4 method for signature 'tiledb_array_schema' is.sparse(object)
object |
tiledb_array_schema |
TRUE if tiledb_array_schema is sparse
By default, TileDB will use all available cores on a given machine. In multi-user or multi-process settings, one may want to reduce the number of core. This function will take a given number, or default to smaller of the ‘Ncpus’ options value or the ‘"OMP_THREAD_LIMIT"’ enviroment variable (or two as hard fallback).
limitTileDBCores(ncores, verbose = FALSE)
limitTileDBCores(ncores, verbose = FALSE)
ncores |
Value of CPUs used, if missing the smaller of a fallback of two, the value of ‘Ncpus’ (if set) and the value of environment variable ‘"OMP_THREAD_LIMIT"’ is used. |
verbose |
Optional logical toggle; if set, a short message is displayed informing the user about the value set. |
As this function returns a config object, its intended use is as argument to the context
creating functions: ctx <- tiledb_ctx(limitTileDBCores())
. To check that the values
are set (or at a later point, still set) the config object should be retrieved via the
corresponding method and this ctx
object: cfg <- config(ctx)
.
The modified configuration object is returned invisibly.
Returns the filter_list's max_chunk_size
max_chunk_size(object) ## S4 method for signature 'tiledb_filter_list' max_chunk_size(object) tiledb_filter_list_get_max_chunk_size(object)
max_chunk_size(object) ## S4 method for signature 'tiledb_filter_list' max_chunk_size(object) tiledb_filter_list_get_max_chunk_size(object)
object |
tiledb_filter_list |
integer max_chunk_size
flt <- tiledb_filter("ZSTD") tiledb_filter_set_option(flt, "COMPRESSION_LEVEL", 5) filter_list <- tiledb_filter_list(c(flt)) max_chunk_size(filter_list)
flt <- tiledb_filter("ZSTD") tiledb_filter_set_option(flt, "COMPRESSION_LEVEL", 5) filter_list <- tiledb_filter_list(c(flt)) max_chunk_size(filter_list)
tiledb_attr
nameReturn the tiledb_attr
name
## S4 method for signature 'tiledb_attr' name(object)
## S4 method for signature 'tiledb_attr' name(object)
object |
|
string name, empty string if the attribute is anonymous
a1 <- tiledb_attr("a1", type = "INT32") name(a1) a2 <- tiledb_attr(type = "INT32") name(a2)
a1 <- tiledb_attr("a1", type = "INT32") name(a1) a2 <- tiledb_attr(type = "INT32") name(a2)
tiledb_dim
nameReturn the tiledb_dim
name
## S4 method for signature 'tiledb_dim' name(object)
## S4 method for signature 'tiledb_dim' name(object)
object |
|
string name, empty string if the dimension is anonymous
d1 <- tiledb_dim("d1", c(1L, 10L)) name(d1) d2 <- tiledb_dim("", c(1L, 10L)) name(d2)
d1 <- tiledb_dim("d1", c(1L, 10L)) name(d1) d2 <- tiledb_dim("", c(1L, 10L)) name(d2)
Returns the filter_list's number of filters
## S4 method for signature 'tiledb_filter_list' nfilters(object)
## S4 method for signature 'tiledb_filter_list' nfilters(object)
object |
tiledb_filter_list |
integer number of filters
flt <- tiledb_filter("ZSTD") tiledb_filter_set_option(flt, "COMPRESSION_LEVEL", 5) filter_list <- tiledb_filter_list(c(flt)) nfilters(filter_list)
flt <- tiledb_filter("ZSTD") tiledb_filter_set_option(flt, "COMPRESSION_LEVEL", 5) filter_list <- tiledb_filter_list(c(flt)) nfilters(filter_list)
The grammar for query conditions is at present constraint to eight operators (">"
,
">="
, "<"
, "<="
, "=="
, "!="
, "%in%"
, "%nin%"
),
and three boolean operators ("&&"
, also as "&"
, ("||"
, also as "|"
,
and "!"
for negation. Note that we locally define "%nin%"
as Negate()
call
around %in%)
which extends R a little for this use case.
parse_query_condition( expr, ta = NULL, debug = FALSE, strict = TRUE, use_int64 = FALSE )
parse_query_condition( expr, ta = NULL, debug = FALSE, strict = TRUE, use_int64 = FALSE )
expr |
An expression that is understood by the TileDB grammar for query conditions. |
ta |
A tiledb_array object that the query condition is applied to; this argument is optional in some cases but required in some others. |
debug |
A boolean toogle to enable more verbose operations, defaults to 'FALSE'. |
strict |
A boolean toogle to, if set, errors if a non-existing attribute is selected or filtered on, defaults to 'TRUE'; if 'FALSE' a warning is shown by execution proceeds. |
use_int64 |
A boolean toggle to switch to |
Expressions are parsed locally by this function. The debug=TRUE
option may help if an issue
has to be diagnosed. In most cases of an errroneous parse, it generally helps to supply the
tiledb_array
providing schema information. One example are numeric and integer columns where
the data type is difficult to guess. Also, when using the "%in%"
or "%nin%"
operators,
the argument is mandatory.
A tiledb_query_condition
object
## Not run: uri <- "mem://airquality" # change to on-disk for persistence fromDataFrame(airquality, uri, col_index=c("Month", "Day")) # dense array ## query condition on dense array requires extended=FALSE tiledb_array(uri, return_as="data.frame", extended=FALSE, query_condition=parse_query_condition(Temp > 90))[] ## End(Not run)
## Not run: uri <- "mem://airquality" # change to on-disk for persistence fromDataFrame(airquality, uri, col_index=c("Month", "Day")) # dense array ## query condition on dense array requires extended=FALSE tiledb_array(uri, return_as="data.frame", extended=FALSE, query_condition=parse_query_condition(Temp > 90))[] ## End(Not run)
Print a TileDB Array Metadata object
## S3 method for class 'tiledb_metadata' print(x, width = NULL, ...)
## S3 method for class 'tiledb_metadata' print(x, width = NULL, ...)
x |
A TileDB array object |
width |
Optional display width, defaults to NULL |
... |
Optional method arguments, currently unused |
The array object, invisibly
A tiledb_array
object can have a corresponding query condition object.
This methods returns it.
query_condition(object) ## S4 method for signature 'tiledb_array' query_condition(object)
query_condition(object) ## S4 method for signature 'tiledb_array' query_condition(object)
object |
A |
A tiledb_query_condition
object
A tiledb_array
object can have an associated query condition object to set
conditions on the read queries. This methods sets the ‘query_condition’ object.
query_condition(x) <- value ## S4 replacement method for signature 'tiledb_array' query_condition(x) <- value
query_condition(x) <- value ## S4 replacement method for signature 'tiledb_array' query_condition(x) <- value
x |
A |
value |
A |
The modified tiledb_array
array object
A tiledb_array
object can have a corresponding query with a given layout
given layout. This methods returns the selection value for ‘query_layout’
as a character value.
query_layout(object) ## S4 method for signature 'tiledb_array' query_layout(object)
query_layout(object) ## S4 method for signature 'tiledb_array' query_layout(object)
object |
A |
A character value describing the query layout
A tiledb_array
object can have an associated query with a specific layout.
This methods sets the selection value for ‘query_layout’ from a character
value.
query_layout(x) <- value ## S4 replacement method for signature 'tiledb_array' query_layout(x) <- value
query_layout(x) <- value ## S4 replacement method for signature 'tiledb_array' query_layout(x) <- value
x |
A |
value |
A character variable for the query layout. Permitted values are “ROW_MAJOR”, “COL_MAJOR”, “GLOBAL_ORDER”, or “UNORDERD”. |
The modified tiledb_array
array object
A tiledb_array
object can, if requested, return query statistics as a JSON
string in an attribute ‘query_statistics’ attached to the return object. The
default value of the logical switch is ‘FALSE’. This method returns the current
value.
query_statistics(object, ...) ## S4 method for signature 'tiledb_array' query_statistics(object)
query_statistics(object, ...) ## S4 method for signature 'tiledb_array' query_statistics(object)
object |
A |
... |
Currently unused |
A logical value indicating whether query statistics are returned.
A tiledb_array
object can, if requested, return query statistics as a JSON
string in an attribute ‘query_statistics’ attached to the return object. The
default value of the logical switch is ‘FALSE’. This method sets the value.
query_statistics(x) <- value ## S4 replacement method for signature 'tiledb_array' query_statistics(x) <- value
query_statistics(x) <- value ## S4 replacement method for signature 'tiledb_array' query_statistics(x) <- value
x |
A |
value |
A logical value with the selection |
The modified tiledb_array
array object
Look up TileDB type corresponding to the type of an R object
r_to_tiledb_type(x)
r_to_tiledb_type(x)
x |
an R array or list |
single character, e.g. INT32
This method used the display method provided by the underlying library.
## S4 method for signature 'tiledb_array_schema' raw_dump(object)
## S4 method for signature 'tiledb_array_schema' raw_dump(object)
object |
An array_schema object |
This method used the display method provided by the underlying library.
## S4 method for signature 'tiledb_attr' raw_dump(object)
## S4 method for signature 'tiledb_attr' raw_dump(object)
object |
An attribute object |
This method used the display method provided by the underlying library.
## S4 method for signature 'tiledb_domain' raw_dump(object)
## S4 method for signature 'tiledb_domain' raw_dump(object)
object |
A domain object |
A tiledb_array
object can be returned as a ‘list’ (default), ‘array’,
‘matrix’, ‘data.frame’, ‘data.table’ or ‘tibble’. This method
permits to select a preference for the returned object. The default value of ‘asis’
means that no conversion is performed.
return_as(object, ...) ## S4 method for signature 'tiledb_array' return_as(object)
return_as(object, ...) ## S4 method for signature 'tiledb_array' return_as(object)
object |
A |
... |
Currently unused |
A character value indicating the preferred conversion where the value is one of ‘asis’ (the default), ‘array’, ‘matrix’,‘data.frame’, ‘data.table’, or ‘tibble’.
A tiledb_array
object can be returned as a ‘list’ (default), ‘array’,
‘matrix’, ‘data.frame’, ‘data.table’ or ‘tibble’. This method
This methods permits to set a preference of returning a list
, array
,
matrix
, data.frame
, a data.table
, or a tibble
. The default
value of “asis” means that no conversion is performed and a list
is returned.
return_as(x) <- value ## S4 replacement method for signature 'tiledb_array' return_as(x) <- value
return_as(x) <- value ## S4 replacement method for signature 'tiledb_array' return_as(x) <- value
x |
A |
value |
A character value with the selection |
The modified tiledb_array
array object
A tiledb_array
object can be returned as an array (or list of arrays),
or, if select, as a data.frame
or as a matrix
. This methods returns
the selection value for the array
selection.
return.array(object, ...) ## S4 method for signature 'tiledb_array' return.array(object)
return.array(object, ...) ## S4 method for signature 'tiledb_array' return.array(object)
object |
A |
... |
Currently unused |
A logical value indicating whether array
return is selected
A tiledb_array
object can be returned as an array (or list of arrays),
or, if select, as a data.frame
or a matrix
. This methods sets the
selection value for a array
.
return.array(x) <- value ## S4 replacement method for signature 'tiledb_array' return.array(x) <- value
return.array(x) <- value ## S4 replacement method for signature 'tiledb_array' return.array(x) <- value
x |
A |
value |
A logical value with the selection |
The modified tiledb_array
array object
A tiledb_array
object can be returned as an array (or list of arrays),
or, if select, as a data.frame
. This methods returns the selection value.
## S4 method for signature 'tiledb_array' return.data.frame(object)
## S4 method for signature 'tiledb_array' return.data.frame(object)
object |
A |
A logical value indicating whether data.frame
return is selected
A tiledb_array
object can be returned as an array (or list of arrays),
or, if select, as a data.frame
. This methods sets the selection value.
## S4 replacement method for signature 'tiledb_array' return.data.frame(x) <- value
## S4 replacement method for signature 'tiledb_array' return.data.frame(x) <- value
x |
A |
value |
A logical value with the selection |
The modified tiledb_array
array object
A tiledb_array
object can be returned as an array (or list of arrays),
or, if select, as a data.frame
or as a matrix
. This methods returns
the selection value for the matrix
selection.
return.matrix(object, ...) ## S4 method for signature 'tiledb_array' return.matrix(object)
return.matrix(object, ...) ## S4 method for signature 'tiledb_array' return.matrix(object)
object |
A |
... |
Currently unused |
A logical value indicating whether matrix
return is selected
A tiledb_array
object can be returned as an array (or list of arrays),
or, if select, as a data.frame
or a matrix
. This methods sets the
selection value for a matrix
.
return.matrix(x) <- value ## S4 replacement method for signature 'tiledb_array' return.matrix(x) <- value
return.matrix(x) <- value ## S4 replacement method for signature 'tiledb_array' return.matrix(x) <- value
x |
A |
value |
A logical value with the selection |
The modified tiledb_array
array object
Save (or load) allocation size default preference in an optional config file
save_allocation_size_preference(value) load_allocation_size_preference() get_allocation_size_preference() set_allocation_size_preference(value)
save_allocation_size_preference(value) load_allocation_size_preference() get_allocation_size_preference() set_allocation_size_preference(value)
value |
A numeric value with the desired allocation size (in bytes). |
When retrieving data from sparse arrays, allocation sizes cannot be determined ex ante as the degree of sparsity is unknown. A configuration value can aide in providing an allocation size value. These functions let the user store such a value for retrieval by their package or script code. The preference will be encoded in a configuration file as R (version 4.0.0 or later) allows a user- and package specific configuration files. These helper functions sets and retrieve the value, respectively, or retrieve the cached value from the package environment where is it set at package load.
The value will be stored as a character value and reparsed so ‘1e6’ and ‘1000000’ are equivalent, and the fixed (but adjustable) number of digits for numerical precision use for formatting will impact the writing. This should have no effect on standard allocation sizes.
The value is used as a limit per column so total memory use per query will a multiple of this value, and increasing in dimension and attribute count.
A fallback value of 10 mb is used if no user value is set.
For the setter, TRUE
is returned invisibly but the function is invoked for the
side effect of storing the value. For the getters, the value as a numeric.
This function requires R version 4.0.0 or later to utilise the per-user config directory accessor function. For older R versions, a fallback from the TileDB configuration object is used.
Save (or load) ‘return_as’ conversion preference in an optional config file
save_return_as_preference( value = c("asis", "array", "matrix", "data.frame", "data.table", "tibble") ) load_return_as_preference() get_return_as_preference() set_return_as_preference( value = c("asis", "array", "matrix", "data.frame", "data.table", "tibble") )
save_return_as_preference( value = c("asis", "array", "matrix", "data.frame", "data.table", "tibble") ) load_return_as_preference() get_return_as_preference() set_return_as_preference( value = c("asis", "array", "matrix", "data.frame", "data.table", "tibble") )
value |
A character variable with one of the six permitted values |
The tiledb_array
object can set a preference for conversion for each retrieved
object. This preference can also be enconded in a configuration file as R (version
4.0.0 or later) allows a user- and package specific configuration files. These helper
functions sets and retrieve the value, respectively, or retrieve the cached value from
the package environment where is it set at package load.
Note that the value must be one of ‘asis’ (the default), ‘array’, ‘matrix’‘data.frame’, ‘data.table’ or ‘tibble’. The latter two require the corresponding package to be installed.
For the setter, TRUE
is returned invisibly but the function is invoked for the
side effect of storing the value. For either getter, the character value.
This function requires R version 4.0.0 or later to utilise the per-user
config directory accessor function. For older R versions, please set the attribute
directly when creating the tiledb_array
object, or via the
return_as()
method.
Returns the tiledb_array
schema for correctness
schema_check(object) ## S4 method for signature 'tiledb_array_schema' schema_check(object) check(object) ## S4 method for signature 'tiledb_array_schema' check(object) tiledb_array_schema_check(object)
schema_check(object) ## S4 method for signature 'tiledb_array_schema' schema_check(object) check(object) ## S4 method for signature 'tiledb_array_schema' check(object) tiledb_array_schema_check(object)
object |
An |
The boolean value TRUE
is returned for a correct
schema; for an incorrect schema an error condition is triggered.
Return a schema from a URI character value
## S4 method for signature 'character' schema(object, ...)
## S4 method for signature 'character' schema(object, ...)
object |
A character variable with a URI |
... |
Extra parameters such as ‘enckey’, the encryption key |
The scheme for the object
Return a schema from a tiledb_array object
## S4 method for signature 'tiledb_array' schema(object, ...)
## S4 method for signature 'tiledb_array' schema(object, ...)
object |
tiledb array object |
... |
Extra parameter for function signature, currently unused |
The scheme for the object
A tiledb_array
object can have a range selection for each dimension
attribute. This methods returns the selection value for ‘selected_points’
and returns a list (with one element per dimension) of vectors where
each row describes one selected points. Alternatively, the list
can be named with the names providing the match to the corresponding dimension.
selected_points(object) ## S4 method for signature 'tiledb_array' selected_points(object)
selected_points(object) ## S4 method for signature 'tiledb_array' selected_points(object)
object |
A |
A list which can contain a vector for each dimension
A tiledb_array
object can have a range selection for each dimension
attribute. This methods sets the selection value for ‘selected_points’
which is a list (with one element per dimension) of two-column matrices where
each row describes one pair of minimum and maximum values. Alternatively, the list
can be named with the names providing the match to the corresponding dimension.
selected_points(x) <- value ## S4 replacement method for signature 'tiledb_array' selected_points(x) <- value
selected_points(x) <- value ## S4 replacement method for signature 'tiledb_array' selected_points(x) <- value
x |
A |
value |
A list of vectors where each list element ‘i’ corresponds to the dimension attribute ‘i’. |
The modified tiledb_array
array object
A tiledb_array
object can have a range selection for each dimension
attribute. This methods returns the selection value for ‘selected_ranges’
and returns a list (with one element per dimension) of two-column matrices where
each row describes one pair of minimum and maximum values. Alternatively, the list
can be named with the names providing the match to the corresponding dimension.
selected_ranges(object) ## S4 method for signature 'tiledb_array' selected_ranges(object)
selected_ranges(object) ## S4 method for signature 'tiledb_array' selected_ranges(object)
object |
A |
A list which can contain a matrix for each dimension
A tiledb_array
object can have a range selection for each dimension
attribute. This methods sets the selection value for ‘selected_ranges’
which is a list (with one element per dimension) of two-column matrices where
each row describes one pair of minimum and maximum values. Alternatively, the list
can be named with the names providing the match to the corresponding dimension.
selected_ranges(x) <- value ## S4 replacement method for signature 'tiledb_array' selected_ranges(x) <- value
selected_ranges(x) <- value ## S4 replacement method for signature 'tiledb_array' selected_ranges(x) <- value
x |
A |
value |
A list of two-column matrices where each list element ‘i’ corresponds to the dimension attribute ‘i’. The matrices can contain rows where each row contains the minimum and maximum value of a range. |
The modified tiledb_array
array object
Set the filter_list's max_chunk_size
set_max_chunk_size(object, value) ## S4 method for signature 'tiledb_filter_list,numeric' set_max_chunk_size(object, value) tiledb_filter_list_set_max_chunk_size(object, value)
set_max_chunk_size(object, value) ## S4 method for signature 'tiledb_filter_list,numeric' set_max_chunk_size(object, value) tiledb_filter_list_set_max_chunk_size(object, value)
object |
tiledb_filter_list |
value |
A numeric value |
flt <- tiledb_filter("ZSTD") tiledb_filter_set_option(flt, "COMPRESSION_LEVEL", 5) filter_list <- tiledb_filter_list(c(flt)) set_max_chunk_size(filter_list, 10)
flt <- tiledb_filter("ZSTD") tiledb_filter_set_option(flt, "COMPRESSION_LEVEL", 5) filter_list <- tiledb_filter_list(c(flt)) set_max_chunk_size(filter_list, 10)
Prints an array schema object
## S4 method for signature 'tiledb_array_schema' show(object)
## S4 method for signature 'tiledb_array_schema' show(object)
object |
An array_schema object |
Prints a tiledb_array object
## S4 method for signature 'tiledb_array' show(object)
## S4 method for signature 'tiledb_array' show(object)
object |
A tiledb array object |
Prints an attribute object
## S4 method for signature 'tiledb_attr' show(object)
## S4 method for signature 'tiledb_attr' show(object)
object |
An attribute object |
Prints the config object to STDOUT
## S4 method for signature 'tiledb_config' show(object)
## S4 method for signature 'tiledb_config' show(object)
object |
|
cfg <- tiledb_config() show(cfg)
cfg <- tiledb_config() show(cfg)
Prints a dimension object
## S4 method for signature 'tiledb_dim' show(object)
## S4 method for signature 'tiledb_dim' show(object)
object |
A dimension object |
Prints a domain object
## S4 method for signature 'tiledb_domain' show(object)
## S4 method for signature 'tiledb_domain' show(object)
object |
A domain object |
Prints a filter_list object
## S4 method for signature 'tiledb_filter_list' show(object)
## S4 method for signature 'tiledb_filter_list' show(object)
object |
A filter_list object |
Prints a filter object
## S4 method for signature 'tiledb_filter' show(object)
## S4 method for signature 'tiledb_filter' show(object)
object |
A filter object |
Display the TileDB Group object to STDOUT
## S4 method for signature 'tiledb_group' show(object)
## S4 method for signature 'tiledb_group' show(object)
object |
|
Batched queries return an initial result set even when it is incomplete. Where the normal retrieval process will loop in place to complete a (potentially large) result set, this function will return a result (which may be part of a larger result set) allowing the user to assemble all part.
statusBatched(obj)
statusBatched(obj)
obj |
A list object as returned by |
The Query status as a character variable
A tiledb_array
object containing character column can have those converted to
factors variables. This methods returns the selection value for ‘strings_as_factors’.
strings_as_factors(object) ## S4 method for signature 'tiledb_array' strings_as_factors(object)
strings_as_factors(object) ## S4 method for signature 'tiledb_array' strings_as_factors(object)
object |
A |
A logical value indicating whether an strings_as_factors
return is selected
A tiledb_array
object containing character column can have those converted to
factors variables. This methods sets the selection value for ‘strings_as_factors’.
strings_as_factors(x) <- value ## S4 replacement method for signature 'tiledb_array' strings_as_factors(x) <- value
strings_as_factors(x) <- value ## S4 replacement method for signature 'tiledb_array' strings_as_factors(x) <- value
x |
A |
value |
A logical value with the selection |
The modified tiledb_array
array object
Collect the query results to finalize piped expression
## S4 method for signature 'tiledb_array' tdb_collect(x, ...)
## S4 method for signature 'tiledb_array' tdb_collect(x, ...)
x |
A tiledb_array object as first argument, permitting piping |
... |
Ignored |
The object returning from a tiledb_array query (the type of which can be
set via the return preference mechanism, see the help for "["
accessor)
Filter from array for query via logical conditions
## S4 method for signature 'tiledb_array' tdb_filter(x, ..., strict = TRUE)
## S4 method for signature 'tiledb_array' tdb_filter(x, ..., strict = TRUE)
x |
A tiledb_array object as first argument, permitting piping |
... |
One or more expressions that are parsed as query_condition objects |
strict |
A boolean toogle to, if set, errors if a non-existing attribute is selected or filtered on, defaults to 'TRUE'; if 'FALSE' a warning is shown by execution proceeds. |
The tiledb_array object, permitting piping
Select attributes from array for query
## S4 method for signature 'tiledb_array' tdb_select(x, ...)
## S4 method for signature 'tiledb_array' tdb_select(x, ...)
x |
A tiledb_array object as first argument, permitting piping |
... |
One or more attributes of the query |
The tiledb_array object, permitting piping
tiledb_array_schema
Returns the tile layout string associated with the tiledb_array_schema
## S4 method for signature 'tiledb_array_schema' tile_order(object)
## S4 method for signature 'tiledb_array_schema' tile_order(object)
object |
tiledb object |
tiledb_dim
tile extentReturn the tiledb_dim
tile extent
## S4 method for signature 'tiledb_dim' tile(object)
## S4 method for signature 'tiledb_dim' tile(object)
object |
|
a scalar tile extent
d1 <- tiledb_dim("d1", domain = c(5L, 10L), tile = 2L) tile(d1)
d1 <- tiledb_dim("d1", domain = c(5L, 10L), tile = 2L) tile(d1)
tiledb_array returns a new object. This class is experimental.
tiledb_array( uri, query_type = c("READ", "WRITE"), is.sparse = NA, as.data.frame = FALSE, attrs = character(), extended = TRUE, selected_ranges = list(), selected_points = list(), query_layout = character(), datetimes_as_int64 = FALSE, encryption_key = character(), as.matrix = FALSE, as.array = FALSE, query_condition = new("tiledb_query_condition"), timestamp_start = as.POSIXct(double(), origin = "1970-01-01"), timestamp_end = as.POSIXct(double(), origin = "1970-01-01"), return_as = get_return_as_preference(), query_statistics = FALSE, strings_as_factors = getOption("stringsAsFactors", FALSE), keep_open = FALSE, sil = list(), dumpbuffers = character(), buffers = list(), ctx = tiledb_get_context() ) tiledb_dense(...) tiledb_sparse(...)
tiledb_array( uri, query_type = c("READ", "WRITE"), is.sparse = NA, as.data.frame = FALSE, attrs = character(), extended = TRUE, selected_ranges = list(), selected_points = list(), query_layout = character(), datetimes_as_int64 = FALSE, encryption_key = character(), as.matrix = FALSE, as.array = FALSE, query_condition = new("tiledb_query_condition"), timestamp_start = as.POSIXct(double(), origin = "1970-01-01"), timestamp_end = as.POSIXct(double(), origin = "1970-01-01"), return_as = get_return_as_preference(), query_statistics = FALSE, strings_as_factors = getOption("stringsAsFactors", FALSE), keep_open = FALSE, sil = list(), dumpbuffers = character(), buffers = list(), ctx = tiledb_get_context() ) tiledb_dense(...) tiledb_sparse(...)
uri |
uri path to the tiledb dense array |
query_type |
optionally loads the array in "READ" or "WRITE" only modes. |
is.sparse |
optional logical switch, defaults to "NA" letting array determine it |
as.data.frame |
optional logical switch, defaults to "FALSE" |
attrs |
optional character vector to select attributes, default is
empty implying all are selected, the special value |
extended |
optional logical switch selecting wide ‘data.frame’
format, defaults to |
selected_ranges |
optional A list with matrices where each matrix i describes the (min,max) pair of ranges selected for dimension i |
selected_points |
optional A list with vectors where each vector i describes the points selected in dimension i |
query_layout |
optional A value for the TileDB query layout, defaults to an empty character variable indicating no special layout is set |
datetimes_as_int64 |
optional A logical value selecting date and datetime value
representation as ‘raw’ |
encryption_key |
optional A character value with an AES-256 encryption key in case the array was written with encryption. |
as.matrix |
optional logical switch, defaults to "FALSE"; currently limited to dense matrices; in the case of multiple attributes in query a list of matrices is returned |
as.array |
optional logical switch, defaults to "FALSE"; in the case of multiple attributes in query a list of arrays is returned |
query_condition |
optional |
timestamp_start |
optional A POSIXct Datetime value determining the inclusive time point at which the array is to be openened. No fragments written earlier will be considered. |
timestamp_end |
optional A POSIXct Datetime value determining the inclusive time point until which the array is to be openened. No fragments written earlier later be considered. |
return_as |
optional A character value with the desired |
query_statistics |
optional A logical value, defaults to ‘FALSE’; if ‘TRUE’ the query statistics are returned (as a JSON string) via the attribute ‘query_statistics’ of the return object. |
strings_as_factors |
An optional logical to convert character columns to factor type; defaults
to the value of |
keep_open |
An optional logical to not close after read or write |
sil |
optional A list, by default empty to store schema information when query objects are parsed. |
dumpbuffers |
An optional character variable with a directory name (relative to
|
buffers |
An optional list with full pathnames of shared memory buffers to read data from |
ctx |
optional tiledb_ctx |
... |
Used as a pass-through for |
tiledb_array object
For dense arrays, use tiledb_query_apply_aggregate
after setting an
appropriate subarray.
tiledb_array_apply_aggregate( array, attrname, operation = c("Count", "NullCount", "Min", "Max", "Mean", "Sum"), nullable = TRUE )
tiledb_array_apply_aggregate( array, attrname, operation = c("Count", "NullCount", "Min", "Max", "Mean", "Sum"), nullable = TRUE )
array |
A TileDB Array object |
attrname |
The name of an attribute |
operation |
The name of aggregation operation |
nullable |
A boolean toggle whether the attribute is nullable |
The value of the aggregation
Close a TileDB Array
tiledb_array_close(arr)
tiledb_array_close(arr)
arr |
A TileDB Array object as for example returned by |
The TileDB Array object but closed
Creates a new TileDB array given an input schema.
tiledb_array_create(uri, schema, encryption_key)
tiledb_array_create(uri, schema, encryption_key)
uri |
URI specifying path to create the TileDB array object |
schema |
tiledb_array_schema object |
encryption_key |
optional A character value with an AES-256 encryption key in case the array should be encryption. |
## Not run: pth <- tempdir() dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"))) tiledb_array_create(pth, sch) tiledb_object_type(pth) ## End(Not run)
## Not run: pth <- tempdir() dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"))) tiledb_array_create(pth, sch) tiledb_object_type(pth) ## End(Not run)
Delete fragments written between the start and end times given
tiledb_array_delete_fragments( arr, ts_start, ts_end, ctx = tiledb_get_context() )
tiledb_array_delete_fragments( arr, ts_start, ts_end, ctx = tiledb_get_context() )
arr |
A TileDB Array object as for example returned by |
ts_start |
A Datetime object that will be converted to millisecond granularity |
ts_end |
A Datetime object that will be converted to millisecond granularity |
ctx |
A tiledb_ctx object (optional) |
A boolean indicating success
This functions works for both fixed- and variable-sized dimensions and switches internally.
tiledb_array_get_non_empty_domain_from_index(arr, idx)
tiledb_array_get_non_empty_domain_from_index(arr, idx)
arr |
A TileDB Array |
idx |
An integer index between one the number of dimensions |
A two-element object is returned describing the domain of selected dimension; it will either be a numeric vector in case of a fixed-size fixed-sized dimensions, or a characer vector for a variable-sized one.
This functions works for both fixed- and variable-sized dimensions and switches internally.
tiledb_array_get_non_empty_domain_from_name(arr, name)
tiledb_array_get_non_empty_domain_from_name(arr, name)
arr |
A TileDB Array |
name |
An character variable with a dimension name |
A two-element object is returned describing the domain of selected dimension; it will either be a numeric vector in case of a fixed-size fixed-sized dimensions, or a characer vector for a variable-sized one.
Check for Enumeration (aka Factor aka Dictionary)
tiledb_array_has_enumeration(arr)
tiledb_array_has_enumeration(arr)
arr |
A TileDB Array object |
A boolean indicating if the array has homogeneous domains
Check for Heterogeneous Domain
tiledb_array_is_heterogeneous(arr)
tiledb_array_is_heterogeneous(arr)
arr |
A TileDB Array object |
A boolean indicating if the array has heterogenous domains
Check for Homogeneous Domain
tiledb_array_is_homogeneous(arr)
tiledb_array_is_homogeneous(arr)
arr |
A TileDB Array object |
A boolean indicating if the array has homogeneous domains
Test if TileDB Array is open
tiledb_array_is_open(arr)
tiledb_array_is_open(arr)
arr |
A TileDB Array object as for example returned by |
A boolean indicating whether the TileDB Array object is open
Open a TileDB Array
tiledb_array_open( arr, type = if (tiledb_version(TRUE) >= "2.12.0") c("READ", "WRITE", "DELETE", "MODIFY_EXCLUSIVE") else c("READ", "WRITE") )
tiledb_array_open( arr, type = if (tiledb_version(TRUE) >= "2.12.0") c("READ", "WRITE", "DELETE", "MODIFY_EXCLUSIVE") else c("READ", "WRITE") )
arr |
A TileDB Array object as for example returned by |
type |
A character value that must be either ‘READ’, ‘WRITE’ or (for TileDB 2.12.0 or later) ‘DELETE’ or ‘MODIFY_EXCLUSIVE’ |
The TileDB Array object but opened for reading or writing
Open a TileDB Array at Timestamp
tiledb_array_open_at(arr, type = c("READ", "WRITE"), timestamp)
tiledb_array_open_at(arr, type = c("READ", "WRITE"), timestamp)
arr |
A TileDB Array object as for example returned by |
type |
A character value that must be either ‘READ’ or ‘WRITE’ |
timestamp |
A Datetime object that will be converted to millisecond granularity |
The TileDB Array object but opened for reading or writing
tiledb_array_schema
objectConstructs a tiledb_array_schema
object
tiledb_array_schema( domain, attrs, cell_order = "COL_MAJOR", tile_order = "COL_MAJOR", sparse = FALSE, coords_filter_list = NULL, offsets_filter_list = NULL, validity_filter_list = NULL, capacity = 10000L, allows_dups = FALSE, enumerations = NULL, ctx = tiledb_get_context() )
tiledb_array_schema( domain, attrs, cell_order = "COL_MAJOR", tile_order = "COL_MAJOR", sparse = FALSE, coords_filter_list = NULL, offsets_filter_list = NULL, validity_filter_list = NULL, capacity = 10000L, allows_dups = FALSE, enumerations = NULL, ctx = tiledb_get_context() )
domain |
tiledb_domain object |
attrs |
a list of one or more tiledb_attr objects |
cell_order |
(default "COL_MAJOR") |
tile_order |
(default "COL_MAJOR") |
sparse |
(default FALSE) |
coords_filter_list |
(optional) |
offsets_filter_list |
(optional) |
validity_filter_list |
(optional) |
capacity |
(optional) |
allows_dups |
(optional, requires ‘sparse’ to be TRUE) |
enumerations |
(optional) named list of enumerations |
ctx |
tiledb_ctx object (optional) |
schema <- tiledb_array_schema( dom = tiledb_domain( dims = c(tiledb_dim("rows", c(1L, 4L), 4L, "INT32"), tiledb_dim("cols", c(1L, 4L), 4L, "INT32"))), attrs = c(tiledb_attr("a", type = "INT32")), cell_order = "COL_MAJOR", tile_order = "COL_MAJOR", sparse = FALSE) schema
schema <- tiledb_array_schema( dom = tiledb_domain( dims = c(tiledb_dim("rows", c(1L, 4L), 4L, "INT32"), tiledb_dim("cols", c(1L, 4L), 4L, "INT32"))), attrs = c(tiledb_attr("a", type = "INT32")), cell_order = "COL_MAJOR", tile_order = "COL_MAJOR", sparse = FALSE) schema
Creates a 'tiledb_array_schema_evolution' object
tiledb_array_schema_evolution(ctx = tiledb_get_context())
tiledb_array_schema_evolution(ctx = tiledb_get_context())
ctx |
(optional) A TileDB Ctx object; if not supplied the default context object is retrieved |
A 'array_schema_evolution' object
Add an Attribute to a TileDB Array Schema Evolution object
tiledb_array_schema_evolution_add_attribute(object, attr)
tiledb_array_schema_evolution_add_attribute(object, attr)
object |
A TileDB 'array_schema_evolution' object |
attr |
A TileDB attribute |
The modified 'array_schema_evolution' object, invisibly
Add an Enumeration to a TileDB Array Schema Evolution object
tiledb_array_schema_evolution_add_enumeration( object, name, enums, ordered = FALSE, ctx = tiledb_get_context() )
tiledb_array_schema_evolution_add_enumeration( object, name, enums, ordered = FALSE, ctx = tiledb_get_context() )
object |
A TileDB 'array_schema_evolution' object |
name |
A character value with the name for the Enumeration |
enums |
A character vector |
ordered |
(optional) A boolean switch whether the enumeration is ordered |
ctx |
(optional) A TileDB Ctx object; if not supplied the default context object is retrieved |
The modified 'array_schema_evolution' object, invisibly
Evolve an Array Schema by adding an empty Enumeration
tiledb_array_schema_evolution_add_enumeration_empty( ase, enum_name, type_str = "ASCII", cell_val_num = NA_integer_, ordered = FALSE, ctx = tiledb_get_context() )
tiledb_array_schema_evolution_add_enumeration_empty( ase, enum_name, type_str = "ASCII", cell_val_num = NA_integer_, ordered = FALSE, ctx = tiledb_get_context() )
ase |
An ArraySchemaEvolution object |
enum_name |
A character value with the Enumeration name |
type_str |
A character value with the TileDB type, defaults to ‘ASCII’ |
cell_val_num |
An integer with number values per cell, defaults to |
ordered |
A logical value indicating standard |
ctx |
Optional tiledb_ctx object |
Evolve an Array Schema
tiledb_array_schema_evolution_array_evolve(object, uri)
tiledb_array_schema_evolution_array_evolve(object, uri)
object |
A TileDB 'array_schema_evolution' object |
uri |
A character variable with an URI |
The modified 'array_schema_evolution' object, invisibly
Drop an attribute given by name from a TileDB Array Schema Evolution object
tiledb_array_schema_evolution_drop_attribute(object, attrname)
tiledb_array_schema_evolution_drop_attribute(object, attrname)
object |
A TileDB 'array_schema_evolution' object |
attrname |
A character variable with an attribute name |
The modified 'array_schema_evolution' object, invisibly
Drop an Enumeration given by name from a TileDB Array Schema Evolution object
tiledb_array_schema_evolution_drop_enumeration(object, attrname)
tiledb_array_schema_evolution_drop_enumeration(object, attrname)
object |
A TileDB 'array_schema_evolution' object |
attrname |
A character variable with an attribute name |
The modified 'array_schema_evolution' object, invisibly
Extend an Evolution via Array Schema Evolution
tiledb_array_schema_evolution_extend_enumeration( ase, array, enum_name, new_values, nullable = FALSE, ordered = FALSE, ctx = tiledb_get_context() )
tiledb_array_schema_evolution_extend_enumeration( ase, array, enum_name, new_values, nullable = FALSE, ordered = FALSE, ctx = tiledb_get_context() )
ase |
An ArraySchemaEvolution object |
array |
A TileDB Array object |
enum_name |
A character value with the Enumeration name |
new_values |
A character vector with the new Enumeration values |
nullable |
A logical value indicating if the Enumeration can contain missing values
(with a default of |
ordered |
A logical value indicating standard |
ctx |
Optional tiledb_ctx object |
An S4 class for a TileDB ArraySchemaEvolution object
ptr
An external pointer to the underlying implementation
Set a Filter List for Coordinate of a TileDB Schema
tiledb_array_schema_set_coords_filter_list(sch, fl)
tiledb_array_schema_set_coords_filter_list(sch, fl)
sch |
A TileDB Array Schema object |
fl |
A TileDB Filter List object |
The modified Array Schema object
Add an empty Enumeration to a Schema
tiledb_array_schema_set_enumeration_empty( schema, attr, enum_name, type_str = "ASCII", cell_val_num = NA_integer_, ordered = FALSE, ctx = tiledb_get_context() )
tiledb_array_schema_set_enumeration_empty( schema, attr, enum_name, type_str = "ASCII", cell_val_num = NA_integer_, ordered = FALSE, ctx = tiledb_get_context() )
schema |
An Array Schema |
attr |
An Attribute for which an empty Enumeration will be added |
enum_name |
A character value with the Enumeration name |
type_str |
A character value with the TileDB type, defaults to ‘ASCII’ |
cell_val_num |
An integer with number values per cell, defaults to |
ordered |
A logical value indicated standard |
ctx |
Optional tiledb_ctx object |
Set a Filter List for Variable-Sized Offsets of a TileDB Schema
tiledb_array_schema_set_offsets_filter_list(sch, fl)
tiledb_array_schema_set_offsets_filter_list(sch, fl)
sch |
A TileDB Array Schema object |
fl |
A TileDB Filter List object |
The modified Array Schema object
Set a Filter List for Validity of a TileDB Schema
tiledb_array_schema_set_validity_filter_list(sch, fl)
tiledb_array_schema_set_validity_filter_list(sch, fl)
sch |
A TileDB Array Schema object |
fl |
A TileDB Filter List object |
The modified Array Schema object
Returns the (internal) version of the tiledb_array
schema
tiledb_array_schema_version(object)
tiledb_array_schema_version(object)
object |
An |
An integer value describing the internal schema format version
An S4 class for the TileDB array schema
ptr
An external pointer to the underlying implementation
arrptr
An optional external pointer to the underlying array, or NULL if missing
Upgrade an Array to the current TileDB Array Schema Format
tiledb_array_upgrade_version(array, config = NULL, ctx = tiledb_get_context())
tiledb_array_upgrade_version(array, config = NULL, ctx = tiledb_get_context())
array |
A TileDB Array object |
config |
A TileDB Configuration (optional, default NULL) |
ctx |
A tiledb_ctx object (optional) |
Nothing is returned as the function is invoked for its side effect
This class replaces the earlier (and now removed) tiledb_dense
and tiledb_sparse
and provides equivalent functionality
based on a refactored implementation utilising newer TileDB features.
ctx
A TileDB context object
uri
A character despription with the array URI
is.sparse
A logical value whether the array is sparse or not
as.data.frame
A logical value
attrs
A character vector to select particular column ‘attributes’;
default is an empty character vector implying ‘all’ columns, the special
value NA_character_
has the opposite effect and selects ‘none’.
extended
A logical value, defaults to TRUE
, indicating whether index
columns are returned as well.
selected_ranges
An optional list with matrices where each matrix i describes the (min,max) pair of ranges for dimension i
selected_points
An optional list with vectors where each vector i describes the selected points for dimension i
query_layout
An optional character value
datetimes_as_int64
A logical value
encryption_key
A character value
as.matrix
A logical value
as.array
A logical value
query_condition
A Query Condition object
timestamp_start
A POSIXct datetime variable for the inclusive interval start
timestamp_end
A POSIXct datetime variable for the inclusive interval start
return_as
A character value with the desired tiledb_array
conversion,
permitted values are ‘asis’ (default, returning a list of columns),
‘array’, ‘matrix’,‘data.frame’, ‘data.table’
‘tibble’, ‘arrow_table’ or ‘arrow’ (where the last two are synomyms);
note that ‘data.table’, ‘tibble’ and ‘arrow’ require the respective
packages to installed.
query_statistics
A logical value, defaults to ‘FALSE’; if ‘TRUE’ the query statistics are returned (as a JSON string) via the attribute ‘query_statistics’ of the return object.
sil
An optional and internal list object with schema information, used for parsing queries.
dumpbuffers
An optional character variable with a directory name (relative to
/dev/shm
) for writing out results buffers (for internal use / testing)
buffers
An optional list with full pathnames of shared memory buffers to read data from
strings_as_factors
An optional logical to convert character columns to factor type
keep_open
An optional logical to not close after read or write
ptr
External pointer to the underlying implementation
These functions allocate (and free) appropriate pointer objects
for, respectively, Arrow array and schema objects. These functions are
deprecated and will be removed, it is recommended to rely directly on
the nanoarrow
replacements.
tiledb_arrow_array_ptr() tiledb_arrow_schema_ptr() tiledb_arrow_array_del(ptr) tiledb_arrow_schema_del(ptr)
tiledb_arrow_array_ptr() tiledb_arrow_schema_ptr() tiledb_arrow_array_del(ptr) tiledb_arrow_schema_del(ptr)
ptr |
A external pointer object previously allocated with these functions |
The allocating functions return the requested pointer
tiledb_attr
objectConstructs a tiledb_attr
object
tiledb_attr( name, type, filter_list = tiledb_filter_list(), ncells = 1, nullable = FALSE, enumeration = NULL, ctx = tiledb_get_context() )
tiledb_attr( name, type, filter_list = tiledb_filter_list(), ncells = 1, nullable = FALSE, enumeration = NULL, ctx = tiledb_get_context() )
name |
The dimension name / label string; if missing default |
type |
The tiledb_attr TileDB datatype string; if missing the user is alerted that this is a required parameter. |
filter_list |
(default filter_list("NONE")) An optional tiledb_filter_list object |
ncells |
(default 1) The number of cells, use |
nullable |
(default FALSE) A logical switch whether the attribute can have missing values |
enumeration |
(default NULL) A character vector of dictionary values |
ctx |
tiledb_ctx object (optional) |
tiledb_dim
object
flt <- tiledb_filter_list(list(tiledb_filter("GZIP"))) attr <- tiledb_attr(name = "a1", type = "INT32", filter_list = flt) attr
flt <- tiledb_filter_list(list(tiledb_filter("GZIP"))) attr <- tiledb_attr(name = "a1", type = "INT32", filter_list = flt) attr
An S4 class for a TileDB attribute
ptr
External pointer to the underlying implementation
Get the TileDB Attribute cell size
tiledb_attribute_get_cell_size(attr)
tiledb_attribute_get_cell_size(attr)
attr |
A TileDB Attribute object |
A numeric value with the cell size
Get the TileDB Attribute Enumeration
tiledb_attribute_get_enumeration(attr, arr, ctx = tiledb_get_context()) tiledb_attribute_get_enumeration_ptr(attr, arrptr, ctx = tiledb_get_context())
tiledb_attribute_get_enumeration(attr, arr, ctx = tiledb_get_context()) tiledb_attribute_get_enumeration_ptr(attr, arrptr, ctx = tiledb_get_context())
attr |
A TileDB Attribute object |
arr |
A Tiledb Array object |
ctx |
A Tiledb Context object (optional) |
arrptr |
A Tiledb Array object pointer |
A character vector with the enumeration (of length zero if none)
Get the fill value for a TileDB Attribute
tiledb_attribute_get_fill_value(attr)
tiledb_attribute_get_fill_value(attr)
attr |
A TileDB Attribute object |
The fill value for the attribute
Get the TileDB Attribute Nullable flag value
tiledb_attribute_get_nullable(attr)
tiledb_attribute_get_nullable(attr)
attr |
A TileDB Attribute object |
A boolean value with the ‘Nullable’ status
Test if TileDB Attribute has an Enumeration
tiledb_attribute_has_enumeration(attr, ctx = tiledb_get_context())
tiledb_attribute_has_enumeration(attr, ctx = tiledb_get_context())
attr |
A TileDB Attribute object |
ctx |
A Tiledb Context object (optional) |
A logical value indicating if the attribute has an enumeration
Check if TileDB Attribute Enumeration is Ordered
tiledb_attribute_is_ordered_enumeration_ptr( attr, arrptr, ctx = tiledb_get_context() )
tiledb_attribute_is_ordered_enumeration_ptr( attr, arrptr, ctx = tiledb_get_context() )
attr |
A Tiledb Array object |
arrptr |
A Tiledb Array object pointer |
ctx |
A Tiledb Context object (optional) |
A character vector with the enumeration (of length zero if none)
Check whether TileDB Attribute is variable-sized
tiledb_attribute_is_variable_sized(attr)
tiledb_attribute_is_variable_sized(attr)
attr |
A TileDB Attribute object |
A boolean value indicating variable-size or not
Set a TileDB Attribute Enumeration Name
tiledb_attribute_set_enumeration_name( attr, enum_name, ctx = tiledb_get_context() )
tiledb_attribute_set_enumeration_name( attr, enum_name, ctx = tiledb_get_context() )
attr |
A TileDB Attribute object |
enum_name |
A character value with the enumeration value |
ctx |
A Tiledb Context object (optional) |
The modified TileDB Attribute object
Set the fill value for a TileDB Attribute
tiledb_attribute_set_fill_value(attr, value)
tiledb_attribute_set_fill_value(attr, value)
attr |
A TileDB Attribute object |
value |
A fill value |
NULL
is returned invisibly
Set the TileDB Attribute Nullable flags
tiledb_attribute_set_nullable(attr, flag)
tiledb_attribute_set_nullable(attr, flag)
attr |
A TileDB Attribute object |
flag |
A boolean flag to turn ‘Nullable’ on or off |
Nothing is returned
tiledb_config
objectNote that for actually setting persistent values, the (altered) config
object needs to used to create (or update) the tiledb_ctx
object. Similarly,
to check whether values are set, one should use the config
method
of the of the tiledb_ctx
object. Examples for this are
ctx <- tiledb_ctx(limitTileDBCores())
to use updated configuration values to
create a context object, and cfg <- config(ctx)
to retrieve it.
tiledb_config(config = NA_character_)
tiledb_config(config = NA_character_)
config |
(optional) character vector of config parameter names, values |
tiledb_config
object
cfg <- tiledb_config() cfg["sm.tile_cache_size"] # set tile cache size to custom value cfg <- tiledb_config(c("sm.tile_cache_size" = "100")) cfg["sm.tile_cache_size"]
cfg <- tiledb_config() cfg["sm.tile_cache_size"] # set tile cache size to custom value cfg <- tiledb_config(c("sm.tile_cache_size" = "100")) cfg["sm.tile_cache_size"]
Return the 'AsBuilt' JSON string
tiledb_config_as_built_json()
tiledb_config_as_built_json()
The JSON string containing 'AsBuilt' information
if (tiledb_version(TRUE) > "2.17") txt <- tiledb::tiledb_config_as_built_json() ## now eg either one of ## sapply(jsonlite::fromJSON(txt)$as_built$parameters$storage_backends, \(x) x[[1]]) ## sapply(RcppSimdJson::fparse(txt)$as_built$parameters$storage_backends, \(x) x[[1]]) ## will return a named vector such as ## c(azure = FALSE, gcs = FALSE, hdfs = FALSE, s3 = TRUE)
if (tiledb_version(TRUE) > "2.17") txt <- tiledb::tiledb_config_as_built_json() ## now eg either one of ## sapply(jsonlite::fromJSON(txt)$as_built$parameters$storage_backends, \(x) x[[1]]) ## sapply(RcppSimdJson::fparse(txt)$as_built$parameters$storage_backends, \(x) x[[1]]) ## will return a named vector such as ## c(azure = FALSE, gcs = FALSE, hdfs = FALSE, s3 = TRUE)
Display the 'AsBuilt' JSON string
tiledb_config_as_built_show()
tiledb_config_as_built_show()
Nothing is returned but as a side-effect the 'AsBuilt' string is displayed
tiledb_config
file from diskLoad a saved tiledb_config
file from disk
tiledb_config_load(path)
tiledb_config_load(path)
path |
path to the config file |
tmp <- tempfile() cfg <- tiledb_config(c("sm.tile_cache_size" = "10")) pth <- tiledb_config_save(cfg, tmp) cfg <- tiledb_config_load(pth) cfg["sm.tile_cache_size"]
tmp <- tempfile() cfg <- tiledb_config(c("sm.tile_cache_size" = "10")) pth <- tiledb_config_save(cfg, tmp) cfg <- tiledb_config_load(pth) cfg["sm.tile_cache_size"]
tiledb_config
object ot a local text fileSave a tiledb_config
object ot a local text file
tiledb_config_save(config, path)
tiledb_config_save(config, path)
config |
The |
path |
The path to config file to be created |
path to created config file
tmp <- tempfile() cfg <- tiledb_config(c("sm.tile_cache_size" = "10")) pth <- tiledb_config_save(cfg, tmp) cat(readLines(pth), sep = "\n")
tmp <- tempfile() cfg <- tiledb_config(c("sm.tile_cache_size" = "10")) pth <- tiledb_config_save(cfg, tmp) cat(readLines(pth), sep = "\n")
Unset a TileDB Config parameter to its default value
tiledb_config_unset(config, param)
tiledb_config_unset(config, param)
config |
A TileDB Config object |
param |
A character variable with the parameter name |
The modified TileDB Config object
An S4 class for a TileDB configuration
ptr
An external pointer to the underlying implementation
tiledb_ctx
objectCreates a tiledb_ctx
object
tiledb_ctx(config = NULL, cached = TRUE)
tiledb_ctx(config = NULL, cached = TRUE)
config |
(optional) character vector of config parameter names, values |
cached |
(optional) logical switch to force new creation |
tiledb_ctx
object
# default configuration ctx <- tiledb_ctx() # optionally set config parameters ctx <- tiledb_ctx(c("sm.tile_cache_size" = "100"))
# default configuration ctx <- tiledb_ctx() # optionally set config parameters ctx <- tiledb_ctx(c("sm.tile_cache_size" = "100"))
Sets default context tags
tiledb_ctx_set_default_tags(object)
tiledb_ctx_set_default_tags(object)
object |
|
Sets a string:string "tag" on the Ctx
tiledb_ctx_set_tag(object, key, value)
tiledb_ctx_set_tag(object, key, value)
object |
|
key |
string |
value |
string |
ctx <- tiledb_ctx(c("sm.tile_cache_size" = "10")) cfg <- tiledb_ctx_set_tag(ctx, "tag", "value")
ctx <- tiledb_ctx(c("sm.tile_cache_size" = "10")) cfg <- tiledb_ctx_set_tag(ctx, "tag", "value")
Return context statistics as a JSON string
tiledb_ctx_stats(object = tiledb_get_context())
tiledb_ctx_stats(object = tiledb_get_context())
object |
|
A JSON-formatted string with context statistics
An S4 class for a TileDB context
ptr
An external pointer to the underlying implementation
This function maps from the TileDB types to the (fewer) key datatypes in R. This can be lossy as TileDB integers range from (signed and unsigned) 8 to 64 bit whereas R only has (signed) 32 bit values. Similarly, R only has 64 bit doubles whereas TileDB has 32 and 64 bit floating point types. TileDB also has more character encodings, and the full range of (NumPy) date and time types.
tiledb_datatype_R_type(datatype)
tiledb_datatype_R_type(datatype)
datatype |
A string describing one TileDB datatype |
A string describing the closest match for an R datatype
Delete a TileDB Array Metadata object given by key
tiledb_delete_metadata(arr, key)
tiledb_delete_metadata(arr, key)
arr |
A TileDB Array object |
key |
A character value describing a metadata key |
A boolean indicating success
tiledb_dim
objectConstructs a tiledb_dim
object
tiledb_dim( name, domain, tile, type, filter_list = tiledb_filter_list(), ctx = tiledb_get_context() )
tiledb_dim( name, domain, tile, type, filter_list = tiledb_filter_list(), ctx = tiledb_get_context() )
name |
The dimension name / label string. This argument is required. |
domain |
The dimension (inclusive) domain. The domain of a dimension
is defined by a (lower bound, upper bound) vector. For type |
tile |
The tile dimension tile extent. For type
|
type |
The dimension TileDB datatype string. |
filter_list |
An optional |
ctx |
tiledb_ctx object (optional) |
tiledb_dim
object
tiledb_dim(name = "d1", domain = c(1L, 10L), tile = 5L, type = "INT32")
tiledb_dim(name = "d1", domain = c(1L, 10L), tile = 5L, type = "INT32")
An S4 class for a TileDB dimension object
ptr
An external pointer to the underlying implementation
tiledb_domain
objectAll tiledb_dim
must be of the same TileDB type.
tiledb_domain(dims, ctx = tiledb_get_context())
tiledb_domain(dims, ctx = tiledb_get_context())
dims |
list() of tiledb_dim objects |
ctx |
tiledb_ctx (optional) |
tiledb_domain
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 100L), type = "INT32"), tiledb_dim("d2", c(1L, 50L), type = "INT32")))
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 100L), type = "INT32"), tiledb_dim("d2", c(1L, 50L), type = "INT32")))
Returns a Dimension indicated by index for the given TileDB Domain
tiledb_domain_get_dimension_from_index(domain, idx)
tiledb_domain_get_dimension_from_index(domain, idx)
domain |
TileDB Domain object |
idx |
Integer index of the selected dimension |
TileDB Dimension object
Returns a Dimension indicated by name for the given TileDB Domain
tiledb_domain_get_dimension_from_name(domain, name)
tiledb_domain_get_dimension_from_name(domain, name)
domain |
TileDB Domain object |
name |
A character variable with a dimension name |
TileDB Dimension object
Check a domain for a given dimension name
tiledb_domain_has_dimension(domain, name)
tiledb_domain_has_dimension(domain, name)
domain |
A domain of a TileDB Array schema |
name |
A character variable with a dimension name |
A boolean value indicating if the dimension exists in the domain
An S4 class for a TileDB domain
ptr
External pointer to the underlying implementation
Note that this function requires an actual error to have occurred.
tiledb_error_message(ctx = tiledb_get_context())
tiledb_error_message(ctx = tiledb_get_context())
ctx |
|
A character variable with the error message
Export from a TileDB Filestore to a character variable
tiledb_filestore_buffer_export( filestore_uri, offset, bytes, ctx = tiledb_get_context() )
tiledb_filestore_buffer_export( filestore_uri, offset, bytes, ctx = tiledb_get_context() )
filestore_uri |
Character with an TileDB Array Schema URI |
offset |
(optional) Numeric variable with offset from beginnig, default is zero |
bytes |
(optional) Numeric variable with number of bytes to read, default is zero |
ctx |
(optional) A TileDB Ctx object; if not supplied the default context object is retrieved |
A character variable containing the filestore content (subject to offset and bytes) is returned
Import size bytes from a string into a TileDB Filestore
tiledb_filestore_buffer_import( filestore_uri, buf, bytes, ctx = tiledb_get_context() )
tiledb_filestore_buffer_import( filestore_uri, buf, bytes, ctx = tiledb_get_context() )
filestore_uri |
Character with an TileDB Array Schema URI |
buf |
Character variable with content to be imported |
bytes |
Number of bytes to be import, defaults to length of |
ctx |
(optional) A TileDB Ctx object; if not supplied the default context object is retrieved |
A boolean is returned to indicate successful completion
Create an array schema from a given URI with schema
tiledb_filestore_schema_create(uri = NULL, ctx = tiledb_get_context())
tiledb_filestore_schema_create(uri = NULL, ctx = tiledb_get_context())
uri |
Character with an TileDB Array Schema URI, if missing or NULL a default schema is returned |
ctx |
(optional) A TileDB Ctx object; if not supplied the default context object is retrieved |
An ArraySchema object corresponding to the supplied schema, or a default if missing
Return (uncompressed) TileDB Filestore size
tiledb_filestore_size(filestore_uri, ctx = tiledb_get_context())
tiledb_filestore_size(filestore_uri, ctx = tiledb_get_context())
filestore_uri |
Character with an TileDB Array Schema URI |
ctx |
(optional) A TileDB Ctx object; if not supplied the default context object is retrieved |
A numeric with the size is returned
Export a file from a TileDB Filestore
tiledb_filestore_uri_export( file_uri, filestore_uri, ctx = tiledb_get_context() )
tiledb_filestore_uri_export( file_uri, filestore_uri, ctx = tiledb_get_context() )
file_uri |
Character with a file URI |
filestore_uri |
Character with an TileDB Array Schema URI |
ctx |
(optional) A TileDB Ctx object; if not supplied the default context object is retrieved |
A boolean is returned to indicate successful completion
Import a file into a TileDB Filestore
tiledb_filestore_uri_import( filestore_uri, file_uri, ctx = tiledb_get_context() )
tiledb_filestore_uri_import( filestore_uri, file_uri, ctx = tiledb_get_context() )
filestore_uri |
Character with an TileDB Array Schema URI |
file_uri |
Character with a file URI |
ctx |
(optional) A TileDB Ctx object; if not supplied the default context object is retrieved |
A boolean is returned to indicate successful completion
tiledb_filter
objectAvailable filters:
"NONE"
"GZIP"
"ZSTD"
"LZ4"
"RLE"
"BZIP2"
"DOUBLE_DELTA"
"BIT_WIDTH_REDUCTION"
"BITSHUFFLE"
"BYTESHUFFLE"
"POSITIVE_DELTA"
"CHECKSUM_MD5"
"CHECKSUM_SHA256"
"DICTIONARY"
"SCALE_FLOAT" (TileDB 2.11.0 or later)
"FILTER_XOR" (TileDB 2.12.0 or later)
tiledb_filter(name = "NONE", ctx = tiledb_get_context())
tiledb_filter(name = "NONE", ctx = tiledb_get_context())
name |
(default "NONE") TileDB filter name string |
ctx |
tiledb_ctx object (optional) |
Valid compression options vary depending on the filter used, consult the TileDB docs for more information.
tiledb_filter object
tiledb_filter("ZSTD")
tiledb_filter("ZSTD")
Returns the filter's option
tiledb_filter_get_option(object, option)
tiledb_filter_get_option(object, option)
object |
tiledb_filter |
option |
string |
Integer value
c <- tiledb_filter("ZSTD") tiledb_filter_set_option(c,"COMPRESSION_LEVEL", 5) tiledb_filter_get_option(c, "COMPRESSION_LEVEL")
c <- tiledb_filter("ZSTD") tiledb_filter_set_option(c,"COMPRESSION_LEVEL", 5) tiledb_filter_get_option(c, "COMPRESSION_LEVEL")
tiledb_filter_list
objectConstructs a tiledb_filter_list
object
tiledb_filter_list(filters = c(), ctx = tiledb_get_context())
tiledb_filter_list(filters = c(), ctx = tiledb_get_context())
filters |
an optional list of one or more tiledb_filter_list objects |
ctx |
tiledb_ctx object (optional) |
tiledb_filter_list object
flt <- tiledb_filter("ZSTD") tiledb_filter_set_option(flt, "COMPRESSION_LEVEL", 5) filter_list <- tiledb_filter_list(c(flt)) filter_list
flt <- tiledb_filter("ZSTD") tiledb_filter_set_option(flt, "COMPRESSION_LEVEL", 5) filter_list <- tiledb_filter_list(c(flt)) filter_list
An S4 class for a TileDB filter list
ptr
An external pointer to the underlying implementation
Set the option for a filter
tiledb_filter_set_option(object, option, value)
tiledb_filter_set_option(object, option, value)
object |
tiledb_filter |
option |
string |
value |
int |
The modified filter object is returned.
c <- tiledb_filter("ZSTD") tiledb_filter_set_option(c,"COMPRESSION_LEVEL", 5) tiledb_filter_get_option(c, "COMPRESSION_LEVEL")
c <- tiledb_filter("ZSTD") tiledb_filter_set_option(c,"COMPRESSION_LEVEL", 5) tiledb_filter_get_option(c, "COMPRESSION_LEVEL")
Returns the type of the filter used
tiledb_filter_type(object)
tiledb_filter_type(object)
object |
tiledb_filter |
TileDB filter type string
c <- tiledb_filter("ZSTD") tiledb_filter_type(c)
c <- tiledb_filter("ZSTD") tiledb_filter_type(c)
An S4 class for a TileDB filter
ptr
External pointer to the underlying implementation
tiledb_fragment_info
objectConstructs a tiledb_fragment_info
object
tiledb_fragment_info(uri, ctx = tiledb_get_context())
tiledb_fragment_info(uri, ctx = tiledb_get_context())
uri |
an character variable with the URI of the array for which fragment info is request |
ctx |
tiledb_ctx object (optional) |
tiledb_fragment_info object
Return if a fragment info index is dense
tiledb_fragment_info_dense(object, fid)
tiledb_fragment_info_dense(object, fid)
object |
A TileDB fragment info object |
fid |
A fragment object index |
A logical value indicating if the fragment is dense
Dump the fragment info to console
tiledb_fragment_info_dump(object)
tiledb_fragment_info_dump(object)
object |
A TileDB fragment info object |
Nothing is returned, as a side effect the fragment info is displayed
Return a fragment info number of cells for a given fragment index
tiledb_fragment_info_get_cell_num(object, fid)
tiledb_fragment_info_get_cell_num(object, fid)
object |
A TileDB fragment info object |
fid |
A fragment object index |
A numeric value with the number of cells
TODO: Rework with type information
tiledb_fragment_info_get_non_empty_domain_index(object, fid, did, typestr)
tiledb_fragment_info_get_non_empty_domain_index(object, fid, did, typestr)
object |
A TileDB fragment info object |
fid |
A fragment object index |
did |
A domain index |
typestr |
An optional character variable describing the data type which will be accessed from the schema if missing |
A TileDB Domain object
TODO: Rework with type information
tiledb_fragment_info_get_non_empty_domain_name(object, fid, dim_name, typestr)
tiledb_fragment_info_get_non_empty_domain_name(object, fid, dim_name, typestr)
object |
A TileDB fragment info object |
fid |
A fragment object index |
dim_name |
A character variable with the dimension name |
typestr |
An optional character variable describing the data type which will be accessed from the schema if missinh |
A TileDB Domain object
Return a fragment info non-empty domain variable from index
tiledb_fragment_info_get_non_empty_domain_var_index(object, fid, did)
tiledb_fragment_info_get_non_empty_domain_var_index(object, fid, did)
object |
A TileDB fragment info object |
fid |
A fragment object index |
did |
A domain index |
A character vector with two elements
Return a fragment info non-empty domain variable from name
tiledb_fragment_info_get_non_empty_domain_var_name(object, fid, dim_name)
tiledb_fragment_info_get_non_empty_domain_var_name(object, fid, dim_name)
object |
A TileDB fragment info object |
fid |
A fragment object index |
dim_name |
A character variable with the dimension name |
A character vector with two elements
Return a fragment info number of fragments
tiledb_fragment_info_get_num(object)
tiledb_fragment_info_get_num(object)
object |
A TileDB fragment info object |
A numeric variable with the number of fragments
Return a fragment info fragment size for a given fragment index
tiledb_fragment_info_get_size(object, fid)
tiledb_fragment_info_get_size(object, fid)
object |
A TileDB fragment info object |
fid |
A fragment object index |
A numeric variable with the number of fragments
Return a fragment info timestamp range for a given fragment index
tiledb_fragment_info_get_timestamp_range(object, fid)
tiledb_fragment_info_get_timestamp_range(object, fid)
object |
A TileDB fragment info object |
fid |
A fragment object index |
A Datetime vector with two elements for the range
Return the number of fragment info elements to be vacuumed
tiledb_fragment_info_get_to_vacuum_num(object)
tiledb_fragment_info_get_to_vacuum_num(object)
object |
A TileDB fragment info object |
A numeric value with the number of to be vacuumed fragments
Return fragment info URI of the to be vacuumed index
tiledb_fragment_info_get_to_vacuum_uri(object, fid)
tiledb_fragment_info_get_to_vacuum_uri(object, fid)
object |
A TileDB fragment info object |
fid |
A fragment object index |
A character variable with the URI of the be vacuumed index
Return fragment info number of unconsolidated metadata
tiledb_fragment_info_get_unconsolidated_metadata_num(object)
tiledb_fragment_info_get_unconsolidated_metadata_num(object)
object |
A TileDB fragment info object |
A numeric value with the number of unconsolidated metadata
Return a fragment info version for a given fragment index
tiledb_fragment_info_get_version(object, fid)
tiledb_fragment_info_get_version(object, fid)
object |
A TileDB fragment info object |
fid |
A fragment object index |
A integer value value with the version
Return if a fragment info index has consolidated metadata
tiledb_fragment_info_has_consolidated_metadata(object, fid)
tiledb_fragment_info_has_consolidated_metadata(object, fid)
object |
A TileDB fragment info object |
fid |
A fragment object index |
A logical value indicating consolidated metadata
Return if a fragment info index is sparse
tiledb_fragment_info_sparse(object, fid)
tiledb_fragment_info_sparse(object, fid)
object |
A TileDB fragment info object |
fid |
A fragment object index |
A logical value indicating if the fragment is sparse
Return a fragment info URI given its index
tiledb_fragment_info_uri(object, fid)
tiledb_fragment_info_uri(object, fid)
object |
A TileDB fragment info object |
fid |
A fragment object index |
A character variable with URI
An S4 class for a TileDB fragment info object
ptr
An external pointer to the underlying implementation
Return all TileDB Array Metadata objects as a named list
tiledb_get_all_metadata(arr)
tiledb_get_all_metadata(arr)
arr |
A TileDB Array object |
A named list with all Metadata objects indexed by the given key
Retrieve a TileDB context object from the package cache
tiledb_get_context()
tiledb_get_context()
A TileDB context object
Return a TileDB Array Metadata object given by key
tiledb_get_metadata(arr, key)
tiledb_get_metadata(arr, key)
arr |
A TileDB Array object |
key |
A character value describing a metadata key |
A object stored in the Metadata under the given key, or ‘NULL’ if none found.
This function accesses the status of the last query without requiring the query object.
tiledb_get_query_status()
tiledb_get_query_status()
The status of the last query
Retrieve a TileDB VFS object from the package environment and cache
tiledb_get_vfs()
tiledb_get_vfs()
A TileDB VFS object
Creates a 'tiledb_group' object
tiledb_group( uri, type = c("READ", "WRITE"), ctx = tiledb_get_context(), cfg = NULL )
tiledb_group( uri, type = c("READ", "WRITE"), ctx = tiledb_get_context(), cfg = NULL )
uri |
Character variable with the URI of the new group object |
type |
Character variable with the query type value: one of “READ” or “WRITE” |
ctx |
(optional) A TileDB Context object; if not supplied the default context object is retrieved |
cfg |
(optional) A TileConfig object |
A 'group' object
Add Member to TileDB Group
tiledb_group_add_member(grp, uri, relative, name = NULL)
tiledb_group_add_member(grp, uri, relative, name = NULL)
grp |
A TileDB Group object as for example returned by |
uri |
A character value with a new URI |
relative |
A logical value indicating whether URI is relative to the group |
name |
An optional character providing a name for the object, defaults to |
The TileDB Group object, invisibly
Close a TileDB Group
tiledb_group_close(grp)
tiledb_group_close(grp)
grp |
A TileDB Group object as for example returned by |
The TileDB Group object but closed for reading or writing
Create a TileDB Group at the given path
tiledb_group_create(uri, ctx = tiledb_get_context())
tiledb_group_create(uri, ctx = tiledb_get_context())
uri |
Character variable with the URI of the new group |
ctx |
(optional) A TileDB Ctx object; if not supplied the default context object is retrieved |
The uri path, invisibly
## Not run: pth <- tempdir() tiledb_group_create(pth) tiledb_object_type(pth) ## End(Not run)
## Not run: pth <- tempdir() tiledb_group_create(pth) tiledb_object_type(pth) ## End(Not run)
Deletes Metadata from a TileDB Group
tiledb_group_delete_metadata(grp, key)
tiledb_group_delete_metadata(grp, key)
grp |
A TileDB Group object as for example returned by |
key |
A character value with they index under which the data will be written |
The TileDB Group object, invisibly
Return all Metadata from a TileDB Group
tiledb_group_get_all_metadata(grp)
tiledb_group_get_all_metadata(grp)
grp |
A TileDB Group object as for example returned by |
A named List with all Metadata objects index
Get a TileDB Config from a TileDB Group
tiledb_group_get_config(grp)
tiledb_group_get_config(grp)
grp |
A TileDB Group object as for example returned by |
The TileDB Config object of the TileDB Group object
Accesses Metadata from a TileDB Group
tiledb_group_get_metadata(grp, key)
tiledb_group_get_metadata(grp, key)
grp |
A TileDB Group object as for example returned by |
key |
A character value with the key of the metadata object to be retrieved |
The requested object, or NULL is not found
Accesses Metadata by Index from a TileDB Group
tiledb_group_get_metadata_from_index(grp, idx)
tiledb_group_get_metadata_from_index(grp, idx)
grp |
A TileDB Group object as for example returned by |
idx |
A numeric value with the index of the metadata object to be retrieved |
The requested object, or NULL is not found
Checks for Metadata in a TileDB Group
tiledb_group_has_metadata(grp, key)
tiledb_group_has_metadata(grp, key)
grp |
A TileDB Group object as for example returned by |
key |
A character value with they index under which the data will be written |
A boolean value indicating with the object is present
Test if TileDB Group is open
tiledb_group_is_open(grp)
tiledb_group_is_open(grp)
grp |
A TileDB Group object as for example returned by |
A boolean indicating whether the TileDB Group object is open
Test if a Named Group is Using a Relative URI
tiledb_group_is_relative(grp, name)
tiledb_group_is_relative(grp, name)
grp |
A TileDB Group object as for example returned by |
name |
A character value with a group name |
A boolean indicating whether the group uses a relative URI or not
This function returns a three-element character vector with the member object translated to character, uri, and optional name.
tiledb_group_member(grp, idx)
tiledb_group_member(grp, idx)
grp |
A TileDB Group object as for example returned by |
idx |
A numeric value with the index of the metadata object to be retrieved |
A character vector with three elements: the member type, its uri, and name
(or ""
if the member is unnamed).
Get Member Count from TileDB Group
tiledb_group_member_count(grp)
tiledb_group_member_count(grp)
grp |
A TileDB Group object as for example returned by |
The Count of Members in the TileDB Group object
Dump the TileDB Group to String
tiledb_group_member_dump(grp, recursive = FALSE)
tiledb_group_member_dump(grp, recursive = FALSE)
grp |
A TileDB Group object as for example returned by |
recursive |
A logical value indicating whether a recursive dump is desired, defaults to ‘FALSE’. Note that recursive listings on remote object may be an expensive or slow operation. |
A character string
Returns Number of Metadata Objects a TileDB Group
tiledb_group_metadata_num(grp)
tiledb_group_metadata_num(grp)
grp |
A TileDB Group object as for example returned by |
A numeric value with the number of metadata objects
Open a TileDB Group
tiledb_group_open(grp, type = c("READ", "WRITE"))
tiledb_group_open(grp, type = c("READ", "WRITE"))
grp |
A TileDB Group object as for example returned by |
type |
A character value that must be either ‘READ’ or ‘WRITE’ |
The TileDB Group object but opened for reading or writing
Write Metadata to a TileDB Group
tiledb_group_put_metadata(grp, key, val)
tiledb_group_put_metadata(grp, key, val)
grp |
A TileDB Group object as for example returned by |
key |
A character value with they index under which the data will be written |
val |
An R object (numeric, int, or char vector) that will be stored |
On success boolean ‘TRUE’ is returned
Return a TileDB Group query type
tiledb_group_query_type(grp)
tiledb_group_query_type(grp)
grp |
A TileDB Group object as for example returned by |
A character value with the query type i.e. one of “READ” or “WRITE”.
Remove Member from TileDB Group
tiledb_group_remove_member(grp, uri)
tiledb_group_remove_member(grp, uri)
grp |
A TileDB Group object as for example returned by |
uri |
A character value with a the URI of the member to be removed, or (if added with a name) the name of the member |
The TileDB Group object, invisibly
Set a TileDB Config for a TileDB Group
tiledb_group_set_config(grp, cfg)
tiledb_group_set_config(grp, cfg)
grp |
A TileDB Group object as for example returned by |
cfg |
A TileDB Config object |
The TileDB Group object with added Config
Return a TileDB Group URI
tiledb_group_uri(grp)
tiledb_group_uri(grp)
grp |
A TileDB Group object as for example returned by |
A character value with the URI
An S4 class for a TileDB Group object
ptr
An external pointer to the underlying implementation
Test if TileDB Array has Metadata
tiledb_has_metadata(arr, key)
tiledb_has_metadata(arr, key)
arr |
A TileDB Array object |
key |
A character value describing a metadata key |
A logical value indicating if the given key exists in the metdata of the given array
The scheme corresponds to the URI scheme for TileDB resouces.
tiledb_is_supported_fs(scheme, object = tiledb_get_context())
tiledb_is_supported_fs(scheme, object = tiledb_get_context())
scheme |
URI string scheme ("file", "hdfs", "s3") |
object |
|
Ex:
{file}:///path/to/file
{hdfs}:///path/to/file
{s3}://hostname:port/path/to/file
TRUE if tiledb backend is supported, FALSE otherwise
tiledb_is_supported_fs("file") tiledb_is_supported_fs("s3")
tiledb_is_supported_fs("file") tiledb_is_supported_fs("s3")
tiledb_array_schema
Return the number of dimensions associated with the tiledb_array_schema
## S4 method for signature 'tiledb_array_schema' tiledb_ndim(object)
## S4 method for signature 'tiledb_array_schema' tiledb_ndim(object)
object |
tiledb_array_schema |
integer number of dimensions
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"), tiledb_attr("a2", type = "FLOAT64"))) tiledb_ndim(sch)
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32"))) sch <- tiledb_array_schema(dom, attrs = c(tiledb_attr("a1", type = "INT32"), tiledb_attr("a2", type = "FLOAT64"))) tiledb_ndim(sch)
Returns the number of dimensions for a tiledb domain object
## S4 method for signature 'tiledb_dim' tiledb_ndim(object)
## S4 method for signature 'tiledb_dim' tiledb_ndim(object)
object |
tiledb_ndim object |
1L
d1 <- tiledb_dim("d1", c(1L, 10L), 10L) tiledb_ndim(d1)
d1 <- tiledb_dim("d1", c(1L, 10L), 10L) tiledb_ndim(d1)
tiledb_domain
Returns the number of dimensions of the tiledb_domain
## S4 method for signature 'tiledb_domain' tiledb_ndim(object)
## S4 method for signature 'tiledb_domain' tiledb_ndim(object)
object |
tiledb_domain |
integer number of dimensions
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(0.5, 100.0), type = "FLOAT64"))) tiledb_ndim(dom) dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(0.5, 100.0), type = "FLOAT64"), tiledb_dim("d2", c(0.5, 100.0), type = "FLOAT64"))) tiledb_ndim(dom)
dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(0.5, 100.0), type = "FLOAT64"))) tiledb_ndim(dom) dom <- tiledb_domain(dims = c(tiledb_dim("d1", c(0.5, 100.0), type = "FLOAT64"), tiledb_dim("d2", c(0.5, 100.0), type = "FLOAT64"))) tiledb_ndim(dom)
Return count of TileDB Array Metadata objects
tiledb_num_metadata(arr)
tiledb_num_metadata(arr)
arr |
A TileDB Array object |
A integer variable with the number of Metadata objects
List TileDB resources at a given root URI path
tiledb_object_ls(uri, filter = NULL, ctx = tiledb_get_context())
tiledb_object_ls(uri, filter = NULL, ctx = tiledb_get_context())
uri |
uri path to walk |
filter |
optional filtering argument, default is "NULL", currently unused |
ctx |
tiledb_ctx object (optional) |
a dataframe with object type, object uri string columns
Raises an error if either uri is invalid, or the old uri resource is not a tiledb object
tiledb_object_mv(old_uri, new_uri, ctx = tiledb_get_context())
tiledb_object_mv(old_uri, new_uri, ctx = tiledb_get_context())
old_uri |
old uri of existing tiledb resource |
new_uri |
new uri to move tiledb resource |
ctx |
tiledb_ctx object (optional) |
new uri of moved tiledb resource
Raises an error if the uri is invalid, or the uri resource is not a tiledb object
tiledb_object_rm(uri, ctx = tiledb_get_context())
tiledb_object_rm(uri, ctx = tiledb_get_context())
uri |
path to TileDB resource |
ctx |
tiledb_ctx object (optional) |
uri of removed TileDB resource
Object types:
"ARRAY"
, dense or sparse TileDB array
"GROUP"
, TileDB group
'"INVALID"“, not a TileDB resource
tiledb_object_type(uri, ctx = tiledb_get_context())
tiledb_object_type(uri, ctx = tiledb_get_context())
uri |
path to TileDB resource |
ctx |
tiledb_ctx object (optional) |
TileDB object type string
Recursively discover TileDB resources at a given root URI path
tiledb_object_walk( uri, order = c("PREORDER", "POSTORDER"), ctx = tiledb_get_context() )
tiledb_object_walk( uri, order = c("PREORDER", "POSTORDER"), ctx = tiledb_get_context() )
uri |
root uri path to walk |
order |
traversal order, one of "PREORDER" and "POSTORDER" (default "PREORDER") |
ctx |
tiledb_ctx object (optional) |
a dataframe with object type, object uri string columns
Store an object in TileDB Array Metadata under given key
tiledb_put_metadata(arr, key, val)
tiledb_put_metadata(arr, key, val)
arr |
A TileDB Array object |
key |
A character value describing a metadata key |
val |
An object to be stored |
A boolean value indicating success
Creates a 'tiledb_query' object
tiledb_query( array, type = if (tiledb_version(TRUE) >= "2.12.0") c("READ", "WRITE", "DELETE", "MODIFY_EXCLUSIVE") else c("READ", "WRITE"), ctx = tiledb_get_context() )
tiledb_query( array, type = if (tiledb_version(TRUE) >= "2.12.0") c("READ", "WRITE", "DELETE", "MODIFY_EXCLUSIVE") else c("READ", "WRITE"), ctx = tiledb_get_context() )
array |
A TileDB Array object |
type |
A character value that must be one of 'READ', 'WRITE', or 'DELETE' (for TileDB >= 2.12.0) |
ctx |
(optional) A TileDB Ctx object |
'tiledb_query' object
Set a range for a given query
tiledb_query_add_range(query, schema, attr, lowval, highval, stride = NULL)
tiledb_query_add_range(query, schema, attr, lowval, highval, stride = NULL)
query |
A TileDB Query object |
schema |
A TileDB Schema object |
attr |
An character variable with a dimension name for which the range is set |
lowval |
The lower value of the range to be set |
highval |
The higher value of the range to be set |
stride |
An optional stride value for the range to be set |
The query object, invisibly
Set a range for a given query, also supplying type
tiledb_query_add_range_with_type( query, idx, datatype, lowval, highval, stride = NULL )
tiledb_query_add_range_with_type( query, idx, datatype, lowval, highval, stride = NULL )
query |
A TileDB Query object |
idx |
An integer index, zero based, of the dimensions |
datatype |
A character value containing the data type |
lowval |
The lower value of the range to be set |
highval |
The highre value of the range to be set |
stride |
An optional stride value for the range to be set |
The query object, invisibly
Allocate a Query buffer for reading a character attribute
tiledb_query_alloc_buffer_ptr_char(sizeoffsets, sizedata, nullable = FALSE)
tiledb_query_alloc_buffer_ptr_char(sizeoffsets, sizedata, nullable = FALSE)
sizeoffsets |
A numeric value with the size of the offsets vector |
sizedata |
A numeric value of the size of the data string |
nullable |
An optional boolean indicating whether the column can have NULLs |
An external pointer to the allocated buffer object
Run an aggregate oprtation on the given query attribute
tiledb_query_apply_aggregate( query, attrname, operation = c("Count", "NullCount", "Min", "Max", "Mean", "Sum"), nullable = TRUE )
tiledb_query_apply_aggregate( query, attrname, operation = c("Count", "NullCount", "Min", "Max", "Mean", "Sum"), nullable = TRUE )
query |
A TileDB Query object |
attrname |
The name of an attribute |
operation |
The name of aggregation operation |
nullable |
A boolean toggle whether the attribute is nullable |
The value of the aggregation
This function allocates a query buffer for the given data type.
tiledb_query_buffer_alloc_ptr( query, datatype, ncells, nullable = FALSE, varnum = 1 )
tiledb_query_buffer_alloc_ptr( query, datatype, ncells, nullable = FALSE, varnum = 1 )
query |
A TileDB Query object |
datatype |
A character value containing the data type |
ncells |
A number of elements (not bytes) |
nullable |
Optional boolean parameter indicating whether missing values are allowed (for which another column is allocated), default is FALSE |
varnum |
Option intgeter parameter for the number of elemements per variable, default is one |
An external pointer to the allocated buffer object
Creates a 'tiledb_query_condition' object
tiledb_query_condition(ctx = tiledb_get_context())
tiledb_query_condition(ctx = tiledb_get_context())
ctx |
(optional) A TileDB Ctx object; if not supplied the default context object is retrieved |
A 'tiledb_query_condition' object
Combines two query condition object using a relatiional operator. Support for operator 'AND' is generally available, the 'OR' operator is available if TileDB 2.10 or newer is used.
tiledb_query_condition_combine(lhs, rhs, op)
tiledb_query_condition_combine(lhs, rhs, op)
lhs |
A 'tiledb_query_condition' object on the left-hand side of the relation |
rhs |
A 'tiledb_query_condition' object on the left-hand side of the relation |
op |
A character value with then relation, this must be one of 'AND', 'OR' or 'NOT'. |
The combined 'tiledb_query_condition' object
Uses ‘IN’ and ‘NOT_IN’ operators on given attribute
tiledb_query_condition_create( name, values, op = "IN", ctx = tiledb_get_context() )
tiledb_query_condition_create( name, values, op = "IN", ctx = tiledb_get_context() )
name |
A character value with the scheme attribute name |
values |
A vector wiith the given values, supported types are integer, double, integer64 and charactor |
op |
(optional) A character value with the chosen set operation, this must be one of ‘IN’ or ‘NOT_IN’; default to ‘IN’ |
ctx |
(optional) A TileDB Ctx object; if not supplied the default context object is retrieved |
A query condition object is returned
Initializes (and possibly allocates) a query condition object using a triplet of attribute name, comparison value, and operator. Six types of conditions are supported, they all take a single scalar comparison argument and attribute to compare against. At present only integer or numeric attribute comparisons are implemented.
tiledb_query_condition_init( attr, value, dtype, op, qc = tiledb_query_condition() )
tiledb_query_condition_init( attr, value, dtype, op, qc = tiledb_query_condition() )
attr |
A character value with the scheme attribute name |
value |
A scalar value that the attribute is compared against |
dtype |
A character value with the TileDB data type of the attribute column, for example 'FLOAT64' or 'INT32' |
op |
A character value with then comparison operation, this must be one of 'LT', 'LE', 'GT', 'GE', 'EQ', 'NE'. |
qc |
(optional) A 'tiledb_query_condition' object to be initialized by this call, if none is given a new one is allocated. |
The initialized 'tiledb_query_condition' object
Set a boolean toggle to signal use of enumeration in query condtion (TileDB 2.17 or later)
tiledb_query_condition_set_use_enumeration( qc, use_enum, ctx = tiledb_get_context() )
tiledb_query_condition_set_use_enumeration( qc, use_enum, ctx = tiledb_get_context() )
qc |
A 'tiledb_query_condition' object |
use_enum |
A boolean to set (if TRUE) or unset (if FALSE) enumeration use |
ctx |
(optional) A TileDB Ctx object; if not supplied the default context object is retrieved |
Nothing is retuned, the function is invoked for the side effect
An S4 class for a TileDB QueryCondition object
ptr
An external pointer to the underlying implementation
init
A logical variable tracking if the query condition object has been initialized
This function allocates a query buffer for the given data object of the given type and assigns the object content to the buffer.
tiledb_query_create_buffer_ptr(query, datatype, object)
tiledb_query_create_buffer_ptr(query, datatype, object)
query |
A TileDB Query object |
datatype |
A character value containing the data type |
object |
A vector object of the given type |
An external pointer to the allocated buffer object
Allocate and populate a Query buffer for writing the given char vector
tiledb_query_create_buffer_ptr_char(query, varvec)
tiledb_query_create_buffer_ptr_char(query, varvec)
query |
A TileDB Query object |
varvec |
A vector of strings |
An external pointer to the allocated buffer object
Return query context object
tiledb_query_ctx(query)
tiledb_query_ctx(query)
query |
A TileDB Query object |
A TileDB Context object retrieved from the query
This function exports the named buffer from a ‘READ’ query to two Arrow C pointers.
tiledb_query_export_buffer(query, name, ctx = tiledb_get_context())
tiledb_query_export_buffer(query, name, ctx = tiledb_get_context())
query |
A TileDB Query object |
name |
A character variable identifying the buffer |
ctx |
tiledb_ctx object (optional) |
A nanoarrow
object (which is an external pointer to an Arrow Array
with the Arrow Schema stored as the external pointer tag) classed as an S3 object
Finalize TileDB Query
tiledb_query_finalize(query)
tiledb_query_finalize(query)
query |
A TileDB Query object |
A character value, either 'READ' or 'WRITE'
This function uses a query buffer for a character attribute or dimension and returns its content.
tiledb_query_get_buffer_char(bufptr, sizeoffsets = 0, sizestring = 0)
tiledb_query_get_buffer_char(bufptr, sizeoffsets = 0, sizestring = 0)
bufptr |
An external pointer with a query buffer |
sizeoffsets |
An optional argument for the length of the internal offsets vector |
sizestring |
An optional argument for the length of the internal string |
An R object as resulting from the query
This function uses a query buffer and returns its content.
tiledb_query_get_buffer_ptr(bufptr)
tiledb_query_get_buffer_ptr(bufptr)
bufptr |
An external pointer with a query buffer |
An R object as resulting from the query
When reading from sparse arrays, one cannot know beforehand how big the result will be (unless one actually executes the query). This function offers a way to get the estimated result size for the given attribute. As TileDB does not actually execute the query, getting the estimated result is very fast.
tiledb_query_get_est_result_size(query, name)
tiledb_query_get_est_result_size(query, name)
query |
A TileDB Query object |
name |
A variable with an attribute name |
An estimate of the query result size
When reading variable-length attributes from either dense or sparse arrays, one cannot know beforehand how big the result will be (unless one actually executes the query). This function offers a way to get the estimated result size for the given attribute. As TileDB does not actually execute the query, getting the estimated result is very fast.
tiledb_query_get_est_result_size_var(query, name)
tiledb_query_get_est_result_size_var(query, name)
query |
A TileDB Query object |
name |
A variable with an attribute name |
An estimate of the query result size
This function is only applicable to ‘WRITE’ queries.
tiledb_query_get_fragment_num(query)
tiledb_query_get_fragment_num(query)
query |
A TileDB Query object |
An integer with the number of fragments for the given query
This function is only applicable to ‘WRITE’ queries. The time resolution in
TileDB is millseconds since the epoch so an R Datetime
vector is returned.
tiledb_query_get_fragment_timestamp_range(query, idx)
tiledb_query_get_fragment_timestamp_range(query, idx)
query |
A TileDB Query object |
idx |
An integer (or numeric) index ranging from zero to the number of fragments minus 1 |
A two-element datetime vector with the start and end time of the fragment write.
This function is only applicable to ‘WRITE’ queries.
tiledb_query_get_fragment_uri(query, idx)
tiledb_query_get_fragment_uri(query, idx)
query |
A TileDB Query object |
idx |
An integer (or numeric) index ranging from zero to the number of fragments minus 1 |
An character value with the fragment URI
Get TileDB Query layout
tiledb_query_get_layout(query)
tiledb_query_get_layout(query)
query |
A TileDB Query object |
The TileDB Query layout as a string
Retrieve the query range for a query dimension and range index
tiledb_query_get_range(query, dimidx, rngidx)
tiledb_query_get_range(query, dimidx, rngidx)
query |
A TileDB Query object |
dimidx |
An integer or numeric index selecting the dimension |
rngidx |
An integer or numeric index selection the given range for the dimension |
An integer vector with elements start, end and stride for the query range for the given dimension and range index
Retrieve the number of ranges for a query dimension
tiledb_query_get_range_num(query, idx)
tiledb_query_get_range_num(query, idx)
query |
A TileDB Query object |
idx |
An integer or numeric index selecting the dimension |
An integer with the number of query range for the given dimensions
Retrieve the query range for a variable-sized query dimension and range index
tiledb_query_get_range_var(query, dimidx, rngidx)
tiledb_query_get_range_var(query, dimidx, rngidx)
query |
A TileDB Query object |
dimidx |
An integer index selecting the variable-sized dimension |
rngidx |
An integer index selection the given range for the dimension |
An string vector with elements start and end for the query range for the given dimension and range index
This function imports to the named buffer for a ‘WRITE’ query from two Arrow exerternal pointers.
tiledb_query_import_buffer( query, name, nanoarrowptr, ctx = tiledb_get_context() )
tiledb_query_import_buffer( query, name, nanoarrowptr, ctx = tiledb_get_context() )
query |
A TileDB Query object |
name |
A character variable identifying the buffer |
nanoarrowptr |
A |
ctx |
tiledb_ctx object (optional) |
The update Query external pointer is returned
The underlying library functions returns a pair of values as a vector of length two. The first number is the number of element offsets for variable size attributes (and always zero for fixed-sized attributes and coordinates). The second is the number of elements in the data buffer. For variable-sized attributes the first number is the number of cells read (and hence the number of offsets), the second number is the number of elements in the data buffer.
tiledb_query_result_buffer_elements(query, attr)
tiledb_query_result_buffer_elements(query, attr)
query |
A TileDB Query object |
attr |
A character value containing the attribute |
As this function was first made available when only a scalar (corresponding to the second result) was returned, we still return that value.
A integer with the number of elements in the results buffer for the given attribute
tiledb_query_result_buffer_elements_vec
The underlying library functions returns a pair of values as a vector of length two. The first number is the number of element offsets for variable size attributes (and always zero for fixed-sized attributes and coordinates). The second is the number of elements in the data buffer. For variable-sized attributes the first number is the number of cells read (and hence the number of offsets), the second number is the number of elements in the data buffer. In the case of a nullable attribute, a third element is returned with the size of the validity buffer.
tiledb_query_result_buffer_elements_vec(query, attr, nullable = FALSE)
tiledb_query_result_buffer_elements_vec(query, attr, nullable = FALSE)
query |
A TileDB Query object |
attr |
A character value containing the attribute |
nullable |
A logical variable that is ‘TRUE’ to signal that the attribute is nullable, and ‘FALSE’ otherwise |
A vector with the number of elements in the offsets buffer (and zero for fixed-size attribute or dimensions), the number elements in the results buffer for the given attribute, and (if nullable) a third element with the validity buffer size.
tiledb_query_result_buffer_elements
This function allocates query buffers directly from R vectors in
case the types match: integer
, double
, logical
. For more
general types see tiledb_query_buffer_alloc_ptr
and
tiledb_query_buffer_assign_ptr
tiledb_query_set_buffer(query, attr, buffer)
tiledb_query_set_buffer(query, attr, buffer)
query |
A TileDB Query object |
attr |
A character value containing the attribute |
buffer |
A vector providing the query buffer |
The modified query object, invisisibly
This function assigns a given query buffer to a query.
tiledb_query_set_buffer_ptr(query, attr, bufptr)
tiledb_query_set_buffer_ptr(query, attr, bufptr)
query |
A TileDB Query object |
attr |
A character value containing the attribute |
bufptr |
An external pointer with a query buffer |
The modified query object, invisibly
Assign a buffer to a Query attribute
tiledb_query_set_buffer_ptr_char(query, attr, bufptr)
tiledb_query_set_buffer_ptr_char(query, attr, bufptr)
query |
A TileDB Query object |
attr |
A character value containing the attribute |
bufptr |
An external pointer with a query buffer |
The modified query object, invisibly
Set a query combination object for a query
tiledb_query_set_condition(query, qc)
tiledb_query_set_condition(query, qc)
query |
A TileDB Query object |
qc |
A TileDB Query Combination object |
The modified query object, invisibly
Set TileDB Query layout
tiledb_query_set_layout( query, layout = c("COL_MAJOR", "ROW_MAJOR", "GLOBAL_ORDER", "UNORDERED") )
tiledb_query_set_layout( query, layout = c("COL_MAJOR", "ROW_MAJOR", "GLOBAL_ORDER", "UNORDERED") )
query |
A TileDB Query object |
layout |
A character variable with the layout; must be one of "COL_MAJOR", "ROW_MAJOR", "GLOBAL_ORDER", "UNORDERED") |
The modified query object, invisibly
Set subarray for TileDB Query object
tiledb_query_set_subarray(query, subarray, type)
tiledb_query_set_subarray(query, subarray, type)
query |
A TileDB Query object |
subarray |
A subarry vector object |
type |
An optional type as a character, if missing type is inferred from the vector. |
The modified query object, invisibly
Return query statistics as a JSON string
tiledb_query_stats(query)
tiledb_query_stats(query)
query |
A TileDB Query object |
A JSON-formatted string with context statistics
Get TileDB Query status
tiledb_query_status(query)
tiledb_query_status(query)
query |
A TileDB Query object |
A character value describing the query status
Note that the query object may need to be finalized
via tiledb_query_finalize
.
tiledb_query_submit(query)
tiledb_query_submit(query)
query |
A TileDB Query object |
The modified query object, invisibly
Note that the query object may need to be finalized
via tiledb_query_finalize
.
tiledb_query_submit_async(query)
tiledb_query_submit_async(query)
query |
A TileDB Query object |
The modified query object, invisibly
Return TileDB Query type
tiledb_query_type(query)
tiledb_query_type(query)
query |
A TileDB Query object |
A character value, either 'READ' or 'WRITE'
An S4 class for a TileDB Query object
ptr
An external pointer to the underlying implementation
Note that this function is an unexported internal function.
tiledb_schema_get_dim_attr_status(sch)
tiledb_schema_get_dim_attr_status(sch)
sch |
A TileDB Schema object |
An integer vector where each element corresponds to a schema entry, and a value of one signals dimension and a value of two an attribute.
Note that this function is an unexported internal function.
tiledb_schema_get_enumeration_status(sch)
tiledb_schema_get_enumeration_status(sch)
sch |
A TileDB Schema object |
An integer vector where each element corresponds to a schema entry, and a value of one signals dimension and a value of two an attribute.
Get all Dimension and Attribute Names
tiledb_schema_get_names(sch)
tiledb_schema_get_names(sch)
sch |
A TileDB Schema object |
A character vector of dimension and attribute names
Get all Dimension and Attribute Types
tiledb_schema_get_types(sch)
tiledb_schema_get_types(sch)
sch |
A TileDB Schema object |
A character vector of dimension and attribute data types
This is an internal function that is not exported.
tiledb_schema_object(array)
tiledb_schema_object(array)
array |
A TileDB Array object |
A list containing two data frames, one describing the overall array as well as one with descriptions about dimensions and attributes in the schema
Store a TileDB context object in the package cache
tiledb_set_context(ctx)
tiledb_set_context(ctx)
ctx |
A TileDB context object |
NULL, invisibly. The function is invoked for the side-effect of storing the VFS object.
Store a TileDB VFS object in the package environment
tiledb_set_vfs(vfs)
tiledb_set_vfs(vfs)
vfs |
A TileDB VFS object |
NULL, invisibly. The function is invoked for the side-effect of storing the VFS object.
This function ends the collection of internal statistics.
tiledb_stats_disable()
tiledb_stats_disable()
Dumps internal TileDB statistics to file or stdout
tiledb_stats_dump(path)
tiledb_stats_dump(path)
path |
Character variable with path to stats file; if the empty string is passed then the result is displayed on stdout. |
pth <- tempfile() tiledb_stats_dump(pth) cat(readLines(pth)[1:10], sep = "\n")
pth <- tempfile() tiledb_stats_dump(pth) cat(readLines(pth)[1:10], sep = "\n")
This function starts the collection of internal statistics.
tiledb_stats_enable()
tiledb_stats_enable()
This function is a convenience wrapper for tiledb_stats_dump
.
tiledb_stats_print()
tiledb_stats_print()
This function requires TileDB Embedded 2.0.3 or later.
tiledb_stats_raw_dump()
tiledb_stats_raw_dump()
txt <- tiledb_stats_raw_dump() cat(txt, "\n")
txt <- tiledb_stats_raw_dump() cat(txt, "\n")
This function is a (now deprecated) convenience wrapper for tiledb_stats_raw_dump
and returns the result as a JSON string.
It required TileDB Embedded 2.0.3 or later.
tiledb_stats_raw_get()
tiledb_stats_raw_get()
This function is a convenience wrapper for tiledb_stats_raw_dump
.
It required TileDB Embedded 2.0.3 or later.
tiledb_stats_raw_print()
tiledb_stats_raw_print()
This function resets the counters for internal statistics.
tiledb_stats_reset()
tiledb_stats_reset()
tiledb_subarray
object from a TileDB QueryConstructs a tiledb_subarray
object from a TileDB Query
tiledb_subarray(query)
tiledb_subarray(query)
query |
A TileDB Query Object |
tiledb_subarray object
Apply a Subarray to a Query
tiledb_subarray_to_query(query, subarray)
tiledb_subarray_to_query(query, subarray)
query |
A TileDB Query Object |
subarray |
A TileDB Subarray Object |
tiledb_query object
An S4 class for a TileDB Subarray
ptr
External pointer to the underlying implementation
The version of the libtiledb library
tiledb_version(compact = FALSE)
tiledb_version(compact = FALSE)
compact |
Logical value indicating wheter a compact
|
An named int vector c(major, minor, patch), or if select,
a package_version
object
tiledb_version() tiledb_version(compact = TRUE)
tiledb_version() tiledb_version(compact = TRUE)
tiledb_vfs
objectCreates a tiledb_vfs
object
tiledb_vfs(config = NULL, ctx = tiledb_get_context())
tiledb_vfs(config = NULL, ctx = tiledb_get_context())
config |
(optional) character vector of config parameter names, values |
ctx |
(optional) A TileDB Ctx object |
The tiledb_vfs
object
# default configuration vfs <- tiledb_vfs()
# default configuration vfs <- tiledb_vfs()
Close a TileDB VFS Filehandle
tiledb_vfs_close(fh, ctx = tiledb_get_context())
tiledb_vfs_close(fh, ctx = tiledb_get_context())
fh |
A TileDB VFS Filehandle external pointer as returned from |
ctx |
(optional) A TileDB Ctx object |
The result of the close operation is returned.
Copy a file to VFS
tiledb_vfs_copy_file(file, uri, vfs = tiledb_get_vfs())
tiledb_vfs_copy_file(file, uri, vfs = tiledb_get_vfs())
file |
Character variable with a local file path |
uri |
Character variable with a URI describing a file path |
vfs |
A TileDB VFS object; default is to use a cached value. |
The uri value of the removed file
Create a VFS Bucket
tiledb_vfs_create_bucket(uri, vfs = tiledb_get_vfs())
tiledb_vfs_create_bucket(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a cloud bucket |
vfs |
A TileDB VFS object; default is to use a cached value. |
The uri value
Create a VFS Directory
tiledb_vfs_create_dir(uri, vfs = tiledb_get_vfs())
tiledb_vfs_create_dir(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a diretory path |
vfs |
A TileDB VFS object; default is to use a cached value. |
The uri value of the created directory
Return VFS Directory Size
tiledb_vfs_dir_size(uri, vfs = tiledb_get_vfs())
tiledb_vfs_dir_size(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a file path |
vfs |
A TileDB VFS object; default is to use a cached value. |
The size of the directory
Empty a VFS Bucket
tiledb_vfs_empty_bucket(uri, vfs = tiledb_get_vfs())
tiledb_vfs_empty_bucket(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a cloud bucket |
vfs |
A TileDB VFS object; default is to use a cached value. |
The URI value that was emptied
Return VFS File Size
tiledb_vfs_file_size(uri, vfs = tiledb_get_vfs())
tiledb_vfs_file_size(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a file path |
vfs |
A TileDB VFS object; default is to use a cached value. |
The size of the file
Check for VFS Bucket
tiledb_vfs_is_bucket(uri, vfs = tiledb_get_vfs())
tiledb_vfs_is_bucket(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a cloud bucket |
vfs |
A TileDB VFS object; default is to use a cached value. |
A boolean value indicating if it is a valid bucket
## Not run: cfg <- tiledb_config() cfg["vfs.s3.region"] <- "us-west-1" ctx <- tiledb_ctx(cfg) vfs <- tiledb_vfs() tiledb_vfs_is_bucket(vfs, "s3://tiledb-public-us-west-1/test-array-4x4") ## End(Not run)
## Not run: cfg <- tiledb_config() cfg["vfs.s3.region"] <- "us-west-1" ctx <- tiledb_ctx(cfg) vfs <- tiledb_vfs() tiledb_vfs_is_bucket(vfs, "s3://tiledb-public-us-west-1/test-array-4x4") ## End(Not run)
Test for VFS Directory
tiledb_vfs_is_dir(uri, vfs = tiledb_get_vfs())
tiledb_vfs_is_dir(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a diretory path |
vfs |
A TileDB VFS object; default is to use a cached value. |
A boolean value indicating if it is a directory
Check for empty VFS Bucket
tiledb_vfs_is_empty_bucket(uri, vfs = tiledb_get_vfs())
tiledb_vfs_is_empty_bucket(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a cloud bucket |
vfs |
A TileDB VFS object; default is to use a cached value. |
A boolean value indicating if it is an empty bucket
## Not run: cfg <- tiledb_config() cfg["vfs.s3.region"] <- "us-west-1" ctx <- tiledb_ctx(cfg) vfs <- tiledb_vfs() tiledb_vfs_is_empty_bucket(vfs, "s3://tiledb-public-us-west-1/test-array-4x4") ## End(Not run)
## Not run: cfg <- tiledb_config() cfg["vfs.s3.region"] <- "us-west-1" ctx <- tiledb_ctx(cfg) vfs <- tiledb_vfs() tiledb_vfs_is_empty_bucket(vfs, "s3://tiledb-public-us-west-1/test-array-4x4") ## End(Not run)
Test for VFS File
tiledb_vfs_is_file(uri, vfs = tiledb_get_vfs())
tiledb_vfs_is_file(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a file path |
vfs |
A TileDB VFS object; default is to use a cached value. |
A boolean value indicating if it is a file
Return VFS Directory Listing
tiledb_vfs_ls(uri, vfs = tiledb_get_vfs())
tiledb_vfs_ls(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a file path |
vfs |
A TileDB VFS object; default is to use a cached value. |
The content of the directory, non-recursive
This functionality is currently limited to S3 URIs.
tiledb_vfs_ls_recursive( uri, vfs = tiledb_get_vfs(), ctx = tiledb_get_context() )
tiledb_vfs_ls_recursive( uri, vfs = tiledb_get_vfs(), ctx = tiledb_get_context() )
uri |
Character variable with a URI describing a file path |
vfs |
(optiona) A TileDB VFS object; default is to use a cached value. |
ctx |
(optional) A TileDB Ctx object |
A data.frame object with two columns for the full path and the object size in bytes
Move (or rename) a VFS Directory
tiledb_vfs_move_dir(olduri, newuri, vfs = tiledb_get_vfs())
tiledb_vfs_move_dir(olduri, newuri, vfs = tiledb_get_vfs())
olduri |
Character variable with an existing URI describing a directory path |
newuri |
Character variable with a new desired URI directory path |
vfs |
A TileDB VFS object; default is to use a cached value. |
The newuri value of the moved directory
Move (or rename) a VFS File
tiledb_vfs_move_file(olduri, newuri, vfs = tiledb_get_vfs())
tiledb_vfs_move_file(olduri, newuri, vfs = tiledb_get_vfs())
olduri |
Character variable with an existing URI describing a file path |
newuri |
Character variable with a new desired URI file path |
vfs |
A TileDB VFS object; default is to use a cached value. |
The newuri value of the moved file
Open a TileDB VFS Filehandle for reading or writing
tiledb_vfs_open( binfile, mode = c("READ", "WRITE", "APPEND"), vfs = tiledb_get_vfs(), ctx = tiledb_get_context() )
tiledb_vfs_open( binfile, mode = c("READ", "WRITE", "APPEND"), vfs = tiledb_get_vfs(), ctx = tiledb_get_context() )
binfile |
A character variable describing the (binary) file to be opened |
mode |
A character variable with value ‘READ’, ‘WRITE’ or ‘APPEND’ |
vfs |
A TileDB VFS object; default is to use a cached value. |
ctx |
(optional) A TileDB Ctx object |
A TileDB VFS Filehandle object (as an external pointer)
This interface currently defaults to reading an integer vector. This is suitable for R objects
as a raw vector used for (de)serialization can be mapped easily to an integer vector. It is
also possible to memcpy
to the contiguous memory of an integer vector should other
(non-R) data be transferred.
tiledb_vfs_read(fh, offset, nbytes, ctx = tiledb_get_context())
tiledb_vfs_read(fh, offset, nbytes, ctx = tiledb_get_context())
fh |
A TileDB VFS Filehandle external pointer as returned from |
offset |
A scalar value with the byte offset from the beginning of the file with a of zero. |
nbytes |
A scalar value with the number of bytes to be read. |
ctx |
(optional) A TileDB Ctx object |
The binary file content is returned as an integer vector.
Remove a VFS Bucket
tiledb_vfs_remove_bucket(uri, vfs = tiledb_get_vfs())
tiledb_vfs_remove_bucket(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a cloud bucket |
vfs |
A TileDB VFS object; default is to use a cached value. |
The uri value
Remove a VFS Directory
tiledb_vfs_remove_dir(uri, vfs = tiledb_get_vfs())
tiledb_vfs_remove_dir(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a diretory path |
vfs |
A TileDB VFS object; default is to use a cached value. |
The uri value of the removed directory
Remove a VFS File
tiledb_vfs_remove_file(uri, vfs = tiledb_get_vfs())
tiledb_vfs_remove_file(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a file path |
vfs |
A TileDB VFS object; default is to use a cached value. |
The uri value of the removed file
Serialize an R Object to a VFS-accessible URI
tiledb_vfs_serialize(obj, uri, vfs = tiledb_get_vfs())
tiledb_vfs_serialize(obj, uri, vfs = tiledb_get_vfs())
obj |
An R object which will be passed to |
uri |
Character variable with a URI describing a file path to an RDS file |
vfs |
A TileDB VFS object; default is to use a cached value. |
The uri is returned invisibly
Sync a TileDB VFS Filehandle
tiledb_vfs_sync(fh, ctx = tiledb_get_context())
tiledb_vfs_sync(fh, ctx = tiledb_get_context())
fh |
A TileDB VFS Filehandle external pointer as returned from |
ctx |
(optional) A TileDB Ctx object |
The result of the sync operation is returned.
Touch a VFS URI Resource
tiledb_vfs_touch(uri, vfs = tiledb_get_vfs())
tiledb_vfs_touch(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a bucket, file or directory |
vfs |
A TileDB VFS object; default is to use a cached value. |
The uri value
Unserialize an R Object from a VFS-accessible URI
tiledb_vfs_unserialize(uri, vfs = tiledb_get_vfs())
tiledb_vfs_unserialize(uri, vfs = tiledb_get_vfs())
uri |
Character variable with a URI describing a file path to an RDS file |
vfs |
A TileDB VFS object; default is to use a cached value. |
The unserialized object
This interface currently defaults to using an integer vector. This is suitable for R objects
as the raw vector result from serialization can be mapped easily to an integer vector. It is
also possible to memcpy
to the contiguous memory of an integer vector should other
(non-R) data be transferred.
tiledb_vfs_write(fh, vec, ctx = tiledb_get_context())
tiledb_vfs_write(fh, vec, ctx = tiledb_get_context())
fh |
A TileDB VFS Filehandle external pointer as returned from |
vec |
An integer vector of content to be written |
ctx |
(optional) A TileDB Ctx object |
The result of the write operation is returned.
An S4 class for a TileDB VFS object
ptr
An external pointer to the underlying implementation