You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Vinupriyaa Muthusamypillai Ananthakrishna <va...@sapient.com> on 2015/06/26 11:14:58 UTC

drill view definition

How can we get the Drill views definition. The sql for which the drill view is created.



Thanks
Vinupriyaa


Re: drill view definition

Posted by Vince Gonzalez <vi...@gmail.com>.
select VIEW_DEFINITION from INFORMATION_SCHEMA.VIEWS where TABLE_NAME
='your_view_name';

On Fri, Jun 26, 2015 at 8:35 AM, Jacques Nadeau <ja...@apache.org> wrote:

> I believe that the information is available from one of the information
> Schema tables.
> On Jun 26, 2015 5:19 AM, "Andy Pernsteiner" <ap...@maprtech.com>
> wrote:
>
> > In Drill, a view is just a JSON file, which will live within the
> workspace
> > where you saved it. EG, if you do:
> >
> > create or replace view dfs.workspace.myview as select * from mytable;
> >
> > It will create a file called 'myview.view.drill' , which will look
> similar
> > to:
> >
> > {
> >   "name" : "testview",
> >   "sql" : "SELECT *\nFROM `drill/new.json`\nFETCH NEXT 10 ROWS ONLY",
> >   "fields" : [ {
> >     "name" : "*",
> >     "type" : "ANY",
> >     "isNullable" : true
> >   } ],
> >   "workspaceSchemaPath" : [ "dfs", "workspace" ]
> > }
> >
> > On Fri, Jun 26, 2015 at 5:14 AM, Vinupriyaa Muthusamypillai
> Ananthakrishna
> > <
> > vananthakrishna@sapient.com> wrote:
> >
> > > How can we get the Drill views definition. The sql for which the drill
> > > view is created.
> > >
> > >
> > >
> > > Thanks
> > > Vinupriyaa
> > >
> > >
> >
> >
> > --
> >  Andy Pernsteiner
> >  Manager, Field Enablement
> > ph: 206.228.0737
> >
> > www.mapr.com
> >
> > Now Available - Free Hadoop On-Demand Training
> > <
> >
> http://www.mapr.com/training?utm_source=Email&utm_medium=Signature&utm_campaign=Free%20available
> > >
> >
>

Re: drill view definition

Posted by Jacques Nadeau <ja...@apache.org>.
I believe that the information is available from one of the information
Schema tables.
On Jun 26, 2015 5:19 AM, "Andy Pernsteiner" <ap...@maprtech.com>
wrote:

> In Drill, a view is just a JSON file, which will live within the workspace
> where you saved it. EG, if you do:
>
> create or replace view dfs.workspace.myview as select * from mytable;
>
> It will create a file called 'myview.view.drill' , which will look similar
> to:
>
> {
>   "name" : "testview",
>   "sql" : "SELECT *\nFROM `drill/new.json`\nFETCH NEXT 10 ROWS ONLY",
>   "fields" : [ {
>     "name" : "*",
>     "type" : "ANY",
>     "isNullable" : true
>   } ],
>   "workspaceSchemaPath" : [ "dfs", "workspace" ]
> }
>
> On Fri, Jun 26, 2015 at 5:14 AM, Vinupriyaa Muthusamypillai Ananthakrishna
> <
> vananthakrishna@sapient.com> wrote:
>
> > How can we get the Drill views definition. The sql for which the drill
> > view is created.
> >
> >
> >
> > Thanks
> > Vinupriyaa
> >
> >
>
>
> --
>  Andy Pernsteiner
>  Manager, Field Enablement
> ph: 206.228.0737
>
> www.mapr.com
>
> Now Available - Free Hadoop On-Demand Training
> <
> http://www.mapr.com/training?utm_source=Email&utm_medium=Signature&utm_campaign=Free%20available
> >
>

Re: drill view definition

Posted by Andy Pernsteiner <ap...@maprtech.com>.
In Drill, a view is just a JSON file, which will live within the workspace
where you saved it. EG, if you do:

create or replace view dfs.workspace.myview as select * from mytable;

It will create a file called 'myview.view.drill' , which will look similar
to:

{
  "name" : "testview",
  "sql" : "SELECT *\nFROM `drill/new.json`\nFETCH NEXT 10 ROWS ONLY",
  "fields" : [ {
    "name" : "*",
    "type" : "ANY",
    "isNullable" : true
  } ],
  "workspaceSchemaPath" : [ "dfs", "workspace" ]
}

On Fri, Jun 26, 2015 at 5:14 AM, Vinupriyaa Muthusamypillai Ananthakrishna <
vananthakrishna@sapient.com> wrote:

> How can we get the Drill views definition. The sql for which the drill
> view is created.
>
>
>
> Thanks
> Vinupriyaa
>
>


-- 
 Andy Pernsteiner
 Manager, Field Enablement
ph: 206.228.0737

www.mapr.com

Now Available - Free Hadoop On-Demand Training
<http://www.mapr.com/training?utm_source=Email&utm_medium=Signature&utm_campaign=Free%20available>