You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Kristine Hahn (JIRA)" <ji...@apache.org> on 2015/06/26 20:49:07 UTC
[jira] [Created] (DRILL-3399) document how to get the Drill views
definition
Kristine Hahn created DRILL-3399:
------------------------------------
Summary: 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
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)