drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristine Hahn (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (DRILL-3399) document how to get the Drill views definition
Date Wed, 12 Aug 2015 18:30:45 GMT

     [ https://issues.apache.org/jira/browse/DRILL-3399?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kristine Hahn closed DRILL-3399.
--------------------------------
    Resolution: Not A Problem

Bridget covered this in the SQL Reference some time ago.

> document how to get the Drill views definition
> ----------------------------------------------
>
>                 Key: DRILL-3399
>                 URL: https://issues.apache.org/jira/browse/DRILL-3399
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 1.0.0
>            Reporter: Kristine Hahn
>            Assignee: Kristine Hahn
>
> Document (if not already covered) how to get a view definition, which is sql for which
the drill view is created:
> {code}
> select VIEW_DEFINITION from INFORMATION_SCHEMA.VIEWS where TABLE_NAME ='your_view_name';
> {code}
> In Drill, a view is just a JSON file, which will live within the workspace where you
saved it. Example:
> {code}
>  create or replace view dfs.workspace.myview as select * from mytable;
> {code}
>  It will create a file called 'myview.view.drill' , which will look
> something like this:
> {code}
>  {
>  "name" : "testview",
>   "sql" : "SELECT *\nFROM `drill/new.json`\nFETCH NEXT 10 ROWS ONLY",
>   "fields" : [ {
>     "name" : "*",
>     "type" : "ANY",
>    "isNullable" : true
>  } ],
>    "workspaceSchemaPath" : [ "dfs", "workspace" ]
>  }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message