Here's an example, Edmon, of what Jacques suggested. Create myplugin
<http://drill.apache.org/docs/storage-plugin-registration/>:

    {
>   "type": "file",
>   "enabled": true,
>   "connection": "file:///",
>   "workspaces": {
>     "ngram": {
>       "location": "/Users/khahn/ngrams",
>       "writable": false,
>       "defaultInputFormat": null
>     }
>   },
>   "formats": {
>     "tsv": {
>       "type": "text",
>       "extensions": [
>         "tsv"
>       ],
>       "delimiter": "\t"
>     }
>   }
>

Then, use this query specifying only the file name.


> USE myplugin.ngram;

SELECT COLUMNS[0],
>                 COLUMNS[1],
>                 COLUMNS[2]
>          FROM `/googlebooks-eng-all-5gram-20120701-zo.tsv`
>          WHERE ((columns[0] = 'Zoological Journal of the Linnean')
>           AND (columns[2] > 250))
>          LIMIT 10;


Kristine Hahn
Sr. Technical Writer
415-497-8107 @krishahn skype:krishahn


On Fri, Aug 28, 2015 at 2:38 PM, Edmon Begoli <[email protected]> wrote:

> Is it possible to set the default workspace and format, so when I am
> running queries in drill
> I can just say:
>
> select columns[1], ..n from `<file>`;
>
> or if there is a sub-dir:
>
> select columns[1], ..n from `\<subdir>\<file>`;
>
> without having to specify workspace?
>

Reply via email to