You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Edmon Begoli <eb...@gmail.com> on 2015/08/28 23:38:01 UTC
Default workspace and plug in
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?
Re: Default workspace and plug in
Posted by Kristine Hahn <kh...@maprtech.com>.
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 <eb...@gmail.com> 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?
>
Re: Default workspace and plug in
Posted by Jacques Nadeau <ja...@dremio.com>.
use dfs.myworkspace;
or similar should work for you
--
Jacques Nadeau
CTO and Co-Founder, Dremio
On Fri, Aug 28, 2015 at 2:38 PM, Edmon Begoli <eb...@gmail.com> 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?
>