Run a SciDB query, optionally returning the result.
Arguments
- db
a scidb database connection from
scidbconnect
- query
a single SciDB query string or scidb array object
- return
if
TRUE
, return the result- binary
set to
FALSE
to read result from SciDB in text form- arrow
set to
TRUE
to read result from SciDB in arrow form- ...
additional options passed to
read.table
whenbinary=FALSE
, or optional result schema whenbinary=TRUE
(see note below).
Note
When query
is an arbitrary AFL query string and binary=TRUE
,
optionally specify schema
with a valid result array schema to skip
an extra metadata lookup query (see scidb
).
Setting return=TRUE
wraps the AFL query
expression with a SciDB
save operator, saving the data on the SciDB server in either binary or text
format depending on the value of the binary
parameter. Please note that
some AFL expressions may not be "saved" using the AFL save operator, including
for instance the AFL create_array operator. Trying to return the result of such
a SciDB expression will result in a run-time error.
Examples
if (FALSE) { # \dontrun{
db <- scidbconnect()
iquery(db, "build(<v:double>[i=1:5], sin(i))", return=TRUE)
## i v
## 1 0.8414710
## 2 0.9092974
## 3 0.1411200
## 4 -0.7568025
## 5 -0.9589243
# Use binary=FALSE and additional options to read.table function:
iquery(db, "build(<val:string>[i=1:3], '[(01),(02),(03)]', true)",
return=TRUE, binary=FALSE, colClasses=c("integer", "character"))
## i val
## 1 1 01
## 2 2 02
## 3 3 03
} # }