Getting started
The following instructions are for the Unix and OSX platforms. Windows support is coming soon.
From Binary
Download the latest version of OptiQL
Extract the distribution:
tar -xzf optiql-0.1-alpha.tgz
Add OptiQL's bin
directory to your path for convenience:
cd optiql-0.1-alpha
export PATH=$PWD/bin:$PATH
Run the OptiQL REPL:
optiql
The first time you run the REPL, it may take a couple of minutes to download OptiQL's dependencies. It will also take a short period to load OptiQL inside the REPL. Because OptiQL is an embedded DSL inside Scala, the OptiQL REPL is the Scala REPL with OptiQL types and operations pre-loaded. To start playing, create a new Table:
val t = Table(1,2,3,4,5)
t Sum(r => r*r)
Example applications are distributed with OptiQL in the apps
folder. To run an application, first we need to compile them:
sbt compile
Next, we can either run an interpreted version of our application directly, or stage it, to run DSL compilation and generate code for different targets. The interpreter version is just a pure Scala library that can be used to develop and prototype before switching to the Delite version for high performance. To run the interpreter version of TPC-H Query 1, run:
delitec TPCHQ1Interpreter [TPC-H data directory]
The data should be in the standard text format provided by the official TPC-H benchmarking scripts.
To run the Delite version of the application, we first stage it using delitec
, and then run it using delite
:
delitec TPCHQ1Compiler
delite TPCHQ1Compiler [TPC-H data directory] -t [num threads]
You should notice that this version runs significantly faster than the interpreter version. To see the code that OptiQL generated, look inside the generated/
folder.