You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Sean Reynolds (JIRA)" <ji...@apache.org> on 2016/01/19 23:56:39 UTC
[jira] [Commented] (DRILL-3399) document how to get the Drill views
definition
[ https://issues.apache.org/jira/browse/DRILL-3399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15107629#comment-15107629 ]
Sean Reynolds commented on DRILL-3399:
--------------------------------------
As of 1/19 this is not covered in the documentation @ https://drill.apache.org/docs/
> 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)