This tutorial covers how to query a file and a directory on your local file
system. Files and directories are like standard SQL tables to Drill. If you
install Drill in embedded
mode, the
installer registers and configures your file system as the dfs
instance.
You can query these types of files using the default dfs
storage plugin:
In this tutorial, you query plain text files using the dfs
storage plugin. You also create a custom storage
plugin to simplify querying plain text files.
This tutorial assumes that you installed Drill in embedded mode. The first few lessons of the tutorial use a Google file of Ngram data that you download from the internet. The compressed Google Ngram files are 8 and 58MB. To expand the compressed files, you need an additional 448MB of free disk space for this exercise.
To get started, use the SQLLine command to start the Drill command line interface (CLI) on Linux, Mac OS X, or Windows.
To start Drill on Linux or Mac OS X, use the SQLLine command.
Navigate to the Drill installation directory.
Example: $ cd ~/apache-drill-<version>
Issue the following command:
$ bin/sqlline -u jdbc:drill:zk=local
The Drill prompt appears: 0: jdbc:drill:zk=local
To start Drill on Windows, use the SQLLine command.
apache-drill-<version>
folder.bin
folder, and double-click on the sqlline.bat
file. The Windows command prompt opens.At the sqlline>
prompt, issue the following command, and then press Enter:
!connect jdbc:drill:zk=local
The following prompt appears: 0: jdbc:drill:zk=local
To stop Drill, issue the following command at the Drill prompt.
0: jdbc:drill:zk=local> !quit
In some cases, such as stopping while a query is in progress, this command does not stop Drill. You need to kill the Drill process. For example, on Mac OS X and Linux, follow these steps:
Search for the Drill process IDs.
$ ps auwx | grep drill
Kill each process using the process numbers in the grep output. For example:
$ sudo kill -9 2674