Search…
RJDBC
OmniSciDB supports the R language using RJDBC.

Examples

Local Host Example

1
library(RJDBC)
2
drv <- JDBC("com.omnisci.jdbc.OmniSciDriver",
3
"/home/omnisci/bin/omnisci-utility-5.6.jar",
4
identifier.quote="'")
5
conn <- dbConnect(drv, "jdbc:omnisci:localhost:6274:omnisci", "admin", "HyperInteractive")
6
dbGetQuery(conn, "SELECT i1 FROM test1 LIMIT 11")
7
dbGetQuery(conn, "SELECT dep_timestamp FROM flights_2008_10k LIMIT 11")
Copied!

Remote Host Example

1
library(RJDBC)
2
drv <- JDBC("com.omnisci.jdbc.OmniSciDriver",
3
"/home/omnisci/bin/omnisci-utility-5.6.jar",
4
identifier.quote="'")
5
conn <- dbConnect(drv,
6
"jdbc:omnisci:colossus.omnisci.com:6274:omnisci",
7
"admin",
8
"HyperInteractive")
9
dbGetQuery(conn,
10
paste("SELECT date_trunc(month, taxi_weather_tracts_factual.pickup_datetime)",
11
" as key0,",
12
"AVG(CASE WHEN 'Hyatt' = ANY",
13
" taxi_weather_tracts_factual.dropoff_store_chains THEN 1 ELSE 0 END)",
14
" AS series_1",
15
"FROM taxi_weather_tracts_factual",
16
"WHERE (taxi_weather_tracts_factual.dropoff_merc_x >= -8254165.98668337",
17
" AND taxi_weather_tracts_factual.dropoff_merc_x < -8218688.304677745)",
18
"AND (taxi_weather_tracts_factual.dropoff_merc_y >= 4966267.65475399",
19
" AND taxi_weather_tracts_factual.dropoff_merc_y < 4989291.122013792)",
20
"AND (",
21
" taxi_weather_tracts_factual.pickup_datetime",
22
" >= TIMESTAMP(0) '2009-12-20 08:13:47'",
23
" AND taxi_weather_tracts_factual.pickup_datetime",
24
" < TIMESTAMP(0) '2015-12-31 23:59:59')",
25
"GROUP BY key0 ORDER BY key0", sep=" "))
Copied!
Last modified 5mo ago
Export as PDF
Copy link