You will need maven 2 or higher
On Ubuntu, you can do this as root:
On the Mac, maven is pre-installed.
Note that installing maven can result in installing java 1.6 and setting that to your default version. Make sure you check java version before compiling or running.
- Java 1.7
You will need java 1.7 to compile and run the Drill demo.
On Ubuntu you can get the right version of Java by doing this as root:
On a Mac, go to Oracle's web-site to download and install java 7. You will also need to set JAVA_HOME in order to use the right version of java.
Drill will not compile correctly using java 6. There is also a subtle problem that can occur if you have both
java 6 and java 7 with the default version set to 6. In that case, you may be able to compile, but execution may not work correctly.
Send email to the dev list if this is a problem for you.
Drill requires Protobuf 2.5. Install this on Ubuntu using :
on Centos 6.4, OEL or RHEL you will need to compile protobuf-compiler
On Ubuntu you can install git by doing this as root:
On the Mac or Windows, go to this site to download and install git.
Check your installation versions
Verify that your default java and maven versions are correct, and that maven runs the right version of java. On my Mac, I see this:
Get the Source
Compile the Code
This takes about a minute on a not-terribly-current MacBook.
Run the interactive Drill shell
The first time you run this program, you will get reams of output. What is happening is that the program is running maven in order to build a (voluminous) class path for the actual program and stores this classpath into the file called
.classpath. When you run this program again, it will note that this file already exists and avoid re-creating it. You should delete this file every time the dependencies of Drill are changed. If you start getting "class not found" errors, that is a good hint that
.classpath is out of date and needs to be deleted and recreated.
-u argument to sqlline is a JDBC connection string that directs sqlline to connect to drill. The Drill JDBC driver currently includes enough smarts to run Drill in embedded mode so this command also effectively starts a local drill bit. The
schema= part of the JDBC connection string causes Drill to consider the "parquet-local" storage engine to be default. Other storage engines can be specified. The list of supported storage engines can be found in the file
./sqlparser/src/main/resources/storage-engines.json. Each storage engine specifies the format of the data and how to get the data. See the section below on "Storage Engines" for more detail.
When you run sqlline, you should see something like this after quite a lot of log messages:
Tip: To quit sqlline at any time, type "!quit" at the prompt.
Run a Query
Once you have sqlline running you can now try out some queries
you should see a whole load of debug messages and then something like