[ 
https://issues.apache.org/jira/browse/DRILL-4514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331419#comment-15331419
 ] 

Arina Ielchiieva commented on DRILL-4514:
-----------------------------------------

h4. Implementation approach:

If schema doesn't have workspaces, all schema properties will be returned 
(information shown in webui storage tab).
If schema has workspaces, all schema properties will be returned + properties 
for indicated workspace ("location", "writable", "defaultInputFormat").

Example:

*1. Schema with workspaces*
When we indicate dfs without workspace, default workspace is implied. So result 
for both commands below will be the same.
{code:sql}
describe schema dfs;
describe schema dfs.default;
{code}
{noformat}
{
  "type" : "file",
  "enabled" : true,
  "connection" : "file:///",
  "config" : null,
  "formats" : {
    "psv" : {
      "type" : "text",
      "extensions" : [ "tbl" ],
      "delimiter" : "|"
    },
    "csv" : {
      "type" : "text",
      "extensions" : [ "csv", "bcp" ],
      "delimiter" : ","
    },
   ... etc
  },
  "location" : "/",
  "writable" : false,
  "defaultInputFormat" : null
}
{noformat}

Results for dfs.tmp and dfs.default will slightly differ. All common properties 
that belong to schema will be the same ("type", "connection", "formats" etc).
Properties "location", "writable", "defaultInputFormat" will differ since they 
belong to workspace.
{code:sql}
describe schema dfs.tmp;
{code}
{noformat}
{
  "type" : "file",
  "enabled" : true,
  "connection" : "file:///",
  "config" : null,
  "formats" : {
    "psv" : {
      "type" : "text",
      "extensions" : [ "tbl" ],
      "delimiter" : "|"
    },
    "csv" : {
      "type" : "text",
      "extensions" : [ "csv", "bcp" ],
      "delimiter" : ","
    },
   ... etc
  },
  "location" : "/tmp",
  "writable" : true,
  "defaultInputFormat" : null
}
{noformat}
*2. Schema without workspaces*
Hive schema doesn't have workspaces so we return all schema properties.
{code:sql}
describe schema hive;
{code}
{noformat}
{
  "type": "hive",
  "enabled": true,
  "configProps": {
    "hive.metastore.uris": "",
    "javax.jdo.option.ConnectionURL": 
"jdbc:derby:;databaseName=../sample-data/drill_hive_db;create=true",
    "hive.metastore.warehouse.dir": "/tmp/drill_hive_wh",
    "fs.default.name": "file:///",
    "hive.metastore.sasl.enabled": "false"
  }
}
{noformat}

> Add describe schema <schema_name> command
> -----------------------------------------
>
>                 Key: DRILL-4514
>                 URL: https://issues.apache.org/jira/browse/DRILL-4514
>             Project: Apache Drill
>          Issue Type: New Feature
>    Affects Versions: Future
>            Reporter: Arina Ielchiieva
>            Assignee: Arina Ielchiieva
>
> Add describe database <db_name> command which will return directory 
> associated with a database on the fly.
> Syntax:
> describe database <db_name>
> describe schema <schema_name>
> Output:
> {noformat}
>  DESCRIBE SCHEMA xdf.proc;
> +---------------------+----------------------------+
> |    name             | location                   |
> +---------------------+----------------------------+
> | xdf.proc            | maprfs://dl.data/processed |
> +---------------------+----------------------------+
> {noformat}
> Current implementation covers only dfs schema.
> For all other "<INFORMATION UNAVAILABLE>" will be returned.



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

Reply via email to