iquery: Run a SciDB query, optionally returning the result.

Description Usage Arguments Note See Also Examples

View source: R/utility.R

Description

Run a SciDB query, optionally returning the result.

Usage

1
iquery(db, query, return = FALSE, binary = TRUE, ...)

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

...

additional options passed to read.table when binary=FALSE, or optional result schema when binary=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 wrapes 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.

See Also

scidb as.R

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
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)",xi
       return=TRUE, binary=FALSE, colClasses=c("integer", "character"))
##   i val
## 1 1  01
## 2 2  02
## 3 3  03

## End(Not run)

scidb documentation built on Aug. 12, 2020, 5:08 p.m.